* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Inter', system-ui, -apple-system, sans-serif;
    background: #eef2f7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #1e293b;
}

.webmail-header {
    background: #ffffff;
    border-bottom: 1px solid #dce5f0;
    padding: 0;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.mail-icon {
    font-size: 28px;
}

.brand {
    font-size: 22px;
    font-weight: 600;
    color: #1e4a76;
}

.top-nav a {
    color: #2c3e66;
    text-decoration: none;
    margin-left: 28px;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
}

.top-nav a:hover {
    color: #1e4a76;
}

.login-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.classic-card {
    background: #ffffff;
    border-radius: 32px;
    box-shadow: 0 20px 38px -12px rgba(0, 0, 0, 0.12);
    width: 100%;
    max-width: 460px;
    padding: 42px 38px;
}

.card-header {
    text-align: center;
    margin-bottom: 32px;
}

.card-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #0f2b3d;
    margin-bottom: 8px;
}

.card-header p {
    color: #5b6e8c;
    font-size: 14px;
}

.domain-badge {
    background: #eef2ff;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 500;
    color: #1e4a76;
    margin-top: 12px;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1e2f41;
    margin-bottom: 6px;
}

.input-field {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1px solid #cfdee9;
    border-radius: 18px;
    background: #fdfdfd;
    transition: all 0.2s;
    font-family: inherit;
}

.input-field:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: white;
}

.input-field.readonly-field {
    background: #f4f7fc;
    border-color: #dce5ef;
    color: #1f3a4b;
    font-weight: 500;
}

.pw-wrapper {
    position: relative;
}

.toggle-pw {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #7e8c9e;
    padding: 4px;
}

.toggle-pw:hover {
    color: #2563eb;
}

.form-extra {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 28px;
}

.checkbox-classic {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #2c3e50;
}

.checkbox-classic input {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

.forgot-link {
    color: #2563eb;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    background: #1a5d9c;
    border: none;
    border-radius: 40px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #1e4a76;
}

.login-btn:hover:not(:disabled) {
    background: #143d60;
    transform: scale(0.98);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.login-btn.loading .btn-text {
    opacity: 0.8;
}
.login-btn.loading .loader {
    display: inline-block;
}

.error-msg {
    background: #fff0f0;
    border-left: 4px solid #d32f2f;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 13px;
    color: #b91c1c;
    margin-top: 20px;
    display: none;
}

.email-hint {
    font-size: 11px;
    margin-top: 6px;
    color: #4f7092;
}

.footer-classic {
    background: white;
    border-top: 1px solid #e2edf7;
    margin-top: auto;
    padding: 18px 0;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #5e6f8d;
}

.footer-links a {
    color: #42648d;
    text-decoration: none;
    margin-left: 24px;
}

.footer-links a:hover {
    color: #1e4a76;
    text-decoration: underline;
}

@media (max-width: 550px) {
    .classic-card {
        padding: 32px 20px;
    }
    .header-container {
        flex-direction: column;
        gap: 8px;
    }
    .top-nav a {
        margin: 0 12px;
    }
    .footer-links a {
        margin-left: 12px;
    }
}

.debug-console {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: #0a1424;
    color: #b3f0c0;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 12px;
    border-radius: 14px;
    max-width: 450px;
    max-height: 320px;
    overflow: auto;
    z-index: 1000;
    border: 1px solid #2a3e5a;
    display: none;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #2a4c6e;
    margin-bottom: 8px;
    padding-bottom: 5px;
    font-weight: bold;
}

.debug-header button {
    background: none;
    border: none;
    color: #8ae2ff;
    cursor: pointer;
    font-size: 14px;
}

.debug-content {
    line-height: 1.4;
    white-space: pre-wrap;
    font-size: 10px;
    font-family: monospace;
}