/*
 * Modern Glassmorphism Design for Eternal Partner
 */

/* General Body Styles */
body {
    font-family: 'Meiryo UI', 'Meiryo', sans-serif; /* Readable sans-serif for body */
    margin: 0;
    color: #333333; /* Black text color */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    /* Stylish multi-layer background */
    background: 
        /* Geometric diagonal stripes */
        linear-gradient(45deg, transparent 25%, rgba(255, 144, 91, 0.015) 25%, rgba(255, 144, 91, 0.015) 50%, transparent 50%, transparent 75%, rgba(255, 144, 91, 0.015) 75%),
        /* Dot pattern */
        radial-gradient(circle at 50% 50%, rgba(255, 144, 91, 0.06) 1px, transparent 1px),
        /* Base gradient */
        linear-gradient(135deg, #fff8f5 0%, #fff0e6 25%, #ffe8d9 50%, #ffeee6 75%, #fff5f0 100%);
    background-size: 
        100px 100px,
        20px 20px,
        100% 100%;
    background-attachment: fixed;
}


/* Glassmorphism Container */
.container {
    width: 100%;
    max-width: 500px; /* Optimized for a sleeker look */
    background: rgba(255, 255, 255, 0.9); /* More opaque white */
    backdrop-filter: blur(15px); /* Enhanced glass effect */
    -webkit-backdrop-filter: blur(15px);
    border-radius: 24px; /* More modern corners */
    border: 1px solid rgba(255, 144, 91, 0.25); /* Light orange border */
    box-shadow: 
        0 8px 32px 0 rgba(255, 144, 91, 0.12),
        0 2px 16px 0 rgba(255, 144, 91, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8); /* Inner highlight */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}


/* Add subtle texture overlay */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 20%, rgba(255, 144, 91, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(255, 165, 107, 0.015) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 24px;
}

/* Header */
.header {
    padding: 40px 20px;
    text-align: center;
}

.header h1 {
    margin: 0;
    font-family: 'Playfair Display', 'Meiryo UI', 'Meiryo', serif; /* Elegant serif for the title with Meiryo UI fallback */
    font-size: 2.8em;
    color: #d2691e; /* Dark orange color */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

/* Main Content */
.main-content {
    padding: 20px 40px 40px;
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 25px; /* Increased gap for better spacing */
    width: 100%;
}

.button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    /* Orange background like login button */
    background: #ff6b35;
    color: #ffffff !important; /* White text like login button */
    text-decoration: none !important;
    padding: 18px 25px;
    border-radius: 16px;
    text-align: center;
    font-size: 1.2em;
    font-weight: 700;
    border: 1px solid rgba(255, 107, 53, 0.3);
    box-shadow: 
        0 4px 12px rgba(255, 144, 91, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.button:hover {
    /* Darker orange on hover like login button */
    background: #e55a2b;
    color: #ffffff !important; /* Keep text white on hover */
    text-decoration: none !important; /* No underline on hover */
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 8px 20px rgba(255, 144, 91, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.button:hover i,
.button:hover span {
    color: #ffffff !important; /* Keep icon and text white on hover */
}


.button i {
    font-size: 1.1em;
    width: 20px; /* Fixed width for icon alignment */
    color: #ffffff !important; /* Ensure icon is white */
}

.button span {
    color: #ffffff !important; /* Ensure text is white */
}

.button:focus,
.button:active,
.button:visited {
    text-decoration: none !important; /* No underline in any state */
    color: #ffffff !important; /* Keep white color in all states */
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
    color: rgba(51, 51, 51, 0.7); /* Softer black for footer text */
    background: rgba(255, 144, 91, 0.1); /* Light orange footer background */
}

/*
 * Form Styles for Login
 */

.form-container {
    width: 100%;
    max-width: 400px;
    color: #333333; /* Black text */
    text-align: center;
    margin-top: -40px;
}

.form-title {
    font-family: 'Playfair Display', 'Meiryo UI', 'Meiryo', serif;
    font-size: 2.2em;
    margin-bottom: 30px;
    color: #d2691e; /* Dark orange */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group:last-of-type {
    margin-bottom: 35px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 0.9em;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 144, 91, 0.3);
    background: rgba(255, 255, 255, 0.8);
    color: #333333; /* Black text */
    font-size: 1em;
    box-sizing: border-box; /* Important for padding */
    transition: background-color 0.3s, box-shadow 0.3s;
}

.input-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 2px rgba(255, 144, 91, 0.5);
}

.form-submit-button {
    width: 100%;
    margin-top: 30px;
    background: #ff6b35; /* Orange for the primary action */
    border-color: rgba(255, 107, 53, 0.3);
    color: #ffffff !important; /* White text for button */
}

.form-submit-button:hover {
    background: #e55a2b; /* Darker orange on hover */
}

.form-links {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
}

.form-links a {
    color: #d2691e; /* Dark orange links */
    text-decoration: none;
    transition: color 0.3s;
}

.form-links a:hover {
    color: #a0522d; /* Darker orange on hover */
    text-decoration: underline;
}

/* Password Reset Link */
.password-reset-link {
    text-align: center;
    margin-top: 20px;
}

.password-reset-link a {
    color: #d2691e; /* Dark orange */
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.password-reset-link a:hover {
    color: #a0522d; /* Darker orange on hover */
    text-decoration: underline;
}

/* Main Menu Link */
.main-menu-link {
    text-align: center;
    margin-top: 15px;
}

.main-menu-link a {
    color: #d2691e; /* Dark orange */
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.main-menu-link a:hover {
    color: #a0522d; /* Darker orange on hover */
    text-decoration: underline;
}

/* Status Messages */
.auth-session-status {
    color: #22c55e; /* Green color for success messages */
    text-align: center;
    background: rgba(34, 197, 94, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
}

/* Success Messages */
.alert-success, .success-message {
    color: #22c55e !important;
    background: rgba(34, 197, 94, 0.1) !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
}

/* Error Messages */
.alert-danger, .error-message {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
}

/* Default Link Styles */
a {
    color: #d2691e !important; /* Dark orange */
    text-decoration: underline !important;
    transition: color 0.3s ease;
}

a:hover {
    color: #a0522d !important; /* Darker orange on hover */
    text-decoration: underline !important;
}

a:visited {
    color: #b8621c !important; /* Slightly different orange for visited */
    text-decoration: underline !important;
}

/* 顧客管理画面のスタイル */
.customer-management {
    width: 100%;
    margin-top: 20px;
}

.customer-table-container {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 144, 91, 0.2);
    overflow: hidden;
    box-shadow: 
        0 4px 20px 0 rgba(255, 144, 91, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    overflow-x: auto;
}

.customer-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 14px;
    background: transparent;
}

.customer-table thead {
    background: linear-gradient(135deg, rgba(255, 144, 91, 0.1) 0%, rgba(255, 144, 91, 0.05) 100%);
}

.customer-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 2px solid rgba(255, 144, 91, 0.15);
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* 列幅の調整 */
.customer-table th:nth-child(1) { width: 5%; }  /* 顧客番号 */
.customer-table th:nth-child(2) { width: 10%; } /* 顧客名 */
.customer-table th:nth-child(3) { width: 8%; }  /* ロール */
.customer-table th:nth-child(4) { width: 18%; } /* メールアドレス */
.customer-table th:nth-child(5) { width: 8%; } /* 契約開始日 */
.customer-table th:nth-child(6) { width: 8%; } /* 契約終了日 */
.customer-table th:nth-child(7) { width: 8%; } /* 契約期間 */
.customer-table th:nth-child(8) { width: 30%; } /* 備考 */
.customer-table th:nth-child(9) { width: 5%; }  /* 操作 */

.customer-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 144, 91, 0.08);
    vertical-align: middle;
}

.customer-table tbody tr {
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.3);
}

.customer-table tbody tr:hover {
    background: rgba(255, 144, 91, 0.05);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 144, 91, 0.1);
}

.customer-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.5);
}

.customer-table tbody tr:nth-child(even):hover {
    background: rgba(255, 144, 91, 0.08);
}

.customer-input {
    width: calc(100% - 4px);
    padding: 8px 12px;
    border: 1px solid rgba(255, 144, 91, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    font-size: 13px;
    color: #2d3748;
    transition: all 0.3s ease;
    min-width: 120px;
    height: 37px;
    box-sizing: border-box;
    margin: 2px;
}

.customer-input:focus {
    outline: none;
    border-color: rgba(255, 144, 91, 0.5);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 0 0 3px rgba(255, 144, 91, 0.1),
        0 2px 8px rgba(255, 144, 91, 0.15);
    transform: translateY(-1px);
}

.customer-input[type="date"] {
    min-width: 140px;
}

.customer-input[data-field="notes"] {
    min-width: 150px;
}

.customer-input[data-field="name"] {
    min-width: 120px;
}

.customer-input[data-field="email"] {
    min-width: 180px;
}

.contract-months {
    font-weight: 600;
    color: #2d3748;
    text-align: center;
    background: transparent;
    padding: 4px 8px;
    min-width: 60px;
    font-size: 12px;
}

.update-btn {
    background: #214bd2;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
    height: 37px;
    box-sizing: border-box;
    margin: 2px;
}

.update-btn:hover {
    background: #1e42c4;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(33, 75, 210, 0.4);
}

.customer-message {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    font-weight: 500;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid;
    display: none;
    animation: slideInFromTop 0.5s ease-out;
}

.customer-message.success {
    background: rgba(72, 187, 120, 0.1);
    color: #2f855a;
    border-color: rgba(72, 187, 120, 0.3);
    box-shadow: 0 4px 20px rgba(72, 187, 120, 0.2);
}

.customer-message.error {
    background: rgba(245, 101, 101, 0.1);
    color: #c53030;
    border-color: rgba(245, 101, 101, 0.3);
    box-shadow: 0 4px 20px rgba(245, 101, 101, 0.2);
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* レスポンシブ対応 */
@media (max-width: 1400px) {
    .customer-input {
        min-width: 100px;
        font-size: 12px;
        padding: 6px 10px;
        height: 33px;
    }
    
    .customer-input[data-field="email"] {
        min-width: 150px;
    }
    
    .customer-input[data-field="notes"] {
        min-width: 120px;
    }
    
    .customer-table th,
    .customer-table td {
        padding: 6px 4px;
    }
    
    .customer-table th {
        font-size: 12px;
    }
    
    .update-btn {
        padding: 6px 14px;
        font-size: 11px;
        min-width: 60px;
        height: 33px;
    }
}

@media (max-width: 1000px) {
    .customer-table-container {
        border-radius: 12px;
    }
    
    .customer-input {
        min-width: 80px;
        font-size: 11px;
        padding: 5px 8px;
        height: 30px;
    }
    
    .customer-input[data-field="email"] {
        min-width: 120px;
    }
    
    .customer-table th,
    .customer-table td {
        padding: 4px 3px;
    }
    
    .contract-months {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .update-btn {
        padding: 5px 10px;
        font-size: 10px;
        min-width: 50px;
        height: 30px;
    }
}

/* 強調クラス */
.text-emphasis {
    color: #d32f2f;
    font-weight: bold;
}