* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Login pages only — do not style body on admin dashboard */
body.login-page,
body.admin-login-mode {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
}

.code-step-desc { margin-bottom: 1rem; color: #555; font-size: 0.95rem; }
.agent-name-display { font-weight: 600; margin-bottom: 1rem; color: #2c3e50; }
.login-btn.btn-secondary { background: #95a5a6; margin-top: 8px; }
.login-btn.btn-secondary:hover { background: #7f8c8d; }

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 8px;
}

.form-group label i {
    margin-right: 8px;
    color: #667eea;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 38px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
}

.toggle-password:hover {
    color: #667eea;
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.error-message {
    background: #fee;
    color: #c0392b;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
    border-left: 4px solid #c0392b;
}

.error-message.show {
    display: block;
}

.approval-waiting {
    text-align: center;
}

.approval-waiting h2 {
    margin: 8px 0;
    font-size: 20px;
    color: #2c3e50;
}

.approval-waiting-icon {
    color: #667eea;
    font-size: 34px;
}

.approval-times {
    margin: 18px 0;
    padding: 12px;
    background: #f7f8fc;
    border-radius: 8px;
    text-align: left;
}

.approval-times div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0;
}

.approval-times dt {
    color: #64748b;
}

.approval-times dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}

@media (max-width: 768px) {
    .login-container {
        max-width: 100%;
    }

    .login-card {
        padding: 28px 20px;
    }

    .login-header h1 {
        font-size: clamp(22px, 5vw, 26px);
    }

    .form-group input[type="text"],
    .form-group input[type="password"] {
        font-size: 16px;
        min-height: 48px;
    }

    .login-btn {
        min-height: 48px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px 16px;
        border-radius: 12px;
    }

    .login-header h1 {
        font-size: 22px;
    }

    .login-icon {
        width: 64px;
        height: 64px;
        font-size: 28px;
    }
}

@media (max-width: 380px) {
    body.login-page,
    body.admin-login-mode {
        padding: 12px;
    }
}
