/* ================================================================
   StudyPro Auth — auth.css
   Login | Register | Forgot Password screens
   ================================================================ */

.sp-auth-wrap {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #4c1d95 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.sp-auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 60px rgba(0,0,0,.35);
    position: relative;
    overflow: hidden;
}

.sp-auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1, #7c3aed, #a855f7);
}

/* Logo / Brand */
.sp-auth-brand {
    text-align: center;
    margin-bottom: 26px;
}
.sp-auth-brand-icon {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 12px;
}
.sp-auth-brand h2 {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 4px;
}
.sp-auth-brand p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* Tabs */
.sp-auth-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 22px;
    gap: 2px;
}
.sp-auth-tab {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all .2s;
    font-family: inherit;
}
.sp-auth-tab.active {
    background: #fff;
    color: #6366f1;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* Screens */
.sp-auth-screen { display: none; }
.sp-auth-screen.active { display: block; }

/* Form */
.sp-auth-form-group {
    margin-bottom: 14px;
}
.sp-auth-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.sp-auth-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    box-sizing: border-box;
}
.sp-auth-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}
.sp-auth-input.error {
    border-color: #ef4444;
}

/* Password wrapper */
.sp-auth-pw-wrap {
    position: relative;
}
.sp-auth-pw-wrap .sp-auth-input {
    padding-right: 42px;
}
.sp-auth-pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 16px;
    padding: 4px;
    line-height: 1;
}

/* Error / Success messages */
.sp-auth-msg {
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 7px;
    margin-bottom: 12px;
    display: none;
}
.sp-auth-msg.error   { background: #fee2e2; color: #dc2626; display: block; }
.sp-auth-msg.success { background: #d1fae5; color: #065f46; display: block; }

/* Submit button */
.sp-auth-submit {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 11px;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: all .25s;
    margin-top: 4px;
    letter-spacing: .3px;
}
.sp-auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(99,102,241,.35);
}
.sp-auth-submit:disabled {
    opacity: .65;
    cursor: not-allowed;
}
.sp-auth-submit.loading::after {
    content: ' ⏳';
}

/* Links */
.sp-auth-links {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    color: #64748b;
}
.sp-auth-links a,
.sp-auth-link-btn {
    color: #6366f1;
    font-weight: 700;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    padding: 0;
}
.sp-auth-links a:hover,
.sp-auth-link-btn:hover { text-decoration: underline; }

/* Divider */
.sp-auth-divider {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    margin: 14px 0;
    position: relative;
}
.sp-auth-divider::before,
.sp-auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: #e2e8f0;
}
.sp-auth-divider::before { left: 0; }
.sp-auth-divider::after  { right: 0; }

/* Profile screen (inside dashboard) */
.sp-profile-wrap {
    max-width: 560px;
    margin: 0 auto;
}
.sp-profile-header {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
    color: #fff;
}
.sp-profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    flex-shrink: 0;
    border: 3px solid rgba(255,255,255,.4);
}
.sp-profile-name  { font-size: 18px; font-weight: 800; }
.sp-profile-phone { font-size: 13px; opacity: .8; margin-top: 2px; }
.sp-profile-card {
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 2px 12px rgba(0,0,0,.05);
    margin-bottom: 14px;
}
.sp-profile-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: .6px;
}
.sp-profile-logout-btn {
    width: 100%;
    padding: 12px;
    border: 1.5px solid #ef4444;
    border-radius: 11px;
    background: transparent;
    color: #ef4444;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
    margin-top: 6px;
}
.sp-profile-logout-btn:hover {
    background: #fee2e2;
}

@media (max-width: 480px) {
    .sp-auth-card { padding: 24px 18px; }
    .sp-auth-wrap { padding: 12px; align-items: flex-start; padding-top: 30px; }
}
