/* Pay10 Login Page Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #e84545;
    --accent: #f59e0b;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    min-height: 100vh;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    margin-bottom: 0.8rem;
}

.logo-icon {
    font-size: 2.5rem;
}

.header h1 {
    color: var(--text-primary);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-group label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.input-group input {
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: #fff;
    color: var(--text-primary);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 69, 69, 0.1);
}

.login-btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 0.9rem 2rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(232, 69, 69, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-loader {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid #fecaca;
    font-size: 0.85rem;
    text-align: center;
}

.success-message {
    background: #f0fdf4;
    color: #15803d;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid #bbf7d0;
    font-size: 0.85rem;
    text-align: center;
}

/* Password fields with a show/hide toggle */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field input {
    width: 100%;
    padding-right: 2.9rem;
}

.toggle-password {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0.4rem;
    border-radius: 6px;
    opacity: 0.45;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.toggle-password:hover {
    opacity: 0.85;
    background: rgba(0, 0, 0, 0.04);
}

.toggle-password--active {
    opacity: 1;
}

.input-group input.input-error {
    border-color: #dc2626;
    background: #fffbfb;
}

.input-group input.input-error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.field-hint {
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: none;
    letter-spacing: 0;
}

.field-error {
    color: #dc2626;
    font-size: 0.75rem;
    min-height: 0.9rem;
    text-transform: none;
    letter-spacing: 0;
}

.required {
    color: var(--primary);
}

/* Divider between signing in and creating a user */
.card-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 1rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.card-divider::before,
.card-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.secondary-btn {
    width: 100%;
    background: #fff;
    color: var(--text-primary);
    border: 1.5px solid var(--border);
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.secondary-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #fffafa;
}

.secondary-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.72rem;
    margin-top: 0.5rem;
}

/* ---------------------------------------------------------------------------
   Add New User modal
   --------------------------------------------------------------------------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
    animation: fade-in 0.15s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
    animation: slide-up 0.2s ease;
}

@keyframes slide-up {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    background: var(--gradient);
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-body form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

.btn-secondary,
.btn-primary {
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 42px;
    min-width: 110px;
}

.btn-secondary {
    background: #fff;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
    color: var(--text-primary);
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(232, 69, 69, 0.3);
}

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.footer {
    text-align: center;
}

.footer p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
}
