/* ==========================================================================
   PORTAL PENDAFTARAN - PESANTREN PUTRI AL-MAWADDAH
   Auth Pages Stylesheet (Login, Register, Verify)
   Simple, Modern, Clean & Fully Responsive
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #1d4ed8;
    --primary-hover: #1e40af;
    --primary-light: #eff6ff;
    --primary-border: #bfdbfe;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-button: 0 4px 12px rgba(29, 78, 216, 0.22);
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --danger-border: #fecaca;
    --success: #10b981;
    --success-light: #ecfdf5;
    --success-border: #a7f3d0;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    -webkit-font-smoothing: antialiased;
}

/* Background Subtle Accent */
.auth-wrapper {
    width: 100%;
    max-width: 440px;
    margin: auto;
}

.auth-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.back-home-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.back-home-link:hover {
    color: var(--primary);
    border-color: var(--primary-border);
    background: var(--primary-light);
    transform: translateX(-2px);
}

/* Auth Card */
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 32px 28px;
    overflow: hidden;
}

/* Header Inside Card */
.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: var(--primary-light);
    border-radius: 50%;
    margin-bottom: 14px;
    border: 2px solid #dbeafe;
}

.auth-logo-wrapper img {
    max-width: 42px;
    max-height: 42px;
    object-fit: contain;
}

.auth-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Alert Boxes */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.45;
}

.alert-success {
    background: var(--success-light);
    border: 1px solid var(--success-border);
    color: #065f46;
}

.alert-danger {
    background: var(--danger-light);
    border: 1px solid var(--danger-border);
    color: #991b1b;
}

.alert i {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Form Groups */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 7px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-light);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.form-input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    font-family: inherit;
    font-size: 0.925rem;
    color: var(--text-main);
    background-color: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.2s ease;
}

.form-input::placeholder {
    color: #94a3b8;
    font-size: 0.875rem;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.form-input.is-invalid {
    border-color: var(--danger);
    background-color: #fffbfa;
}

.form-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Password Toggle Button */
.btn-toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.btn-toggle-password:hover {
    color: var(--text-main);
}

/* Field with toggle has right padding */
.input-with-toggle {
    padding-right: 42px;
}

/* OTP Code Specific */
.otp-input {
    letter-spacing: 0.28em;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    padding-left: 14px !important;
}

/* Field Error Text */
.field-error {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 6px;
    font-weight: 500;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-button);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 8px;
}

.btn-submit:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
}

/* Helper & Footer Links */
.auth-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.auth-footer-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s ease;
}

.auth-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.auth-secondary-link {
    display: block;
    margin-top: 10px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-decoration: none;
}

.auth-secondary-link:hover {
    color: var(--text-main);
    text-decoration: underline;
}

.auth-page-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    body {
        padding: 16px 12px;
    }

    .auth-card {
        padding: 24px 18px;
        border-radius: var(--radius-md);
    }

    .auth-title {
        font-size: 1.25rem;
    }

    .auth-subtitle {
        font-size: 0.8125rem;
    }

    .form-input {
        font-size: 16px; /* Prevents auto-zoom in mobile Safari / iOS */
    }
}
