/*
 * card.css — Generic card/form page layout.
 *
 * Used by: /settings, /settings/profile-edit, /settings/change-password,
 *          /settings/verification, /contact-us
 *
 * NOT for login/register — use auth.css for those.
 *
 * @author  Mr.Server hossam.net HOSSAM ALZYOD
 * @version 1.0
 */

/* ================================================================
   PAGE WRAPPER
   ================================================================ */
.card-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: radial-gradient(ellipse at 60% 0%, rgba(0,201,167,.15) 0%, transparent 60%),
                #0f1923;
}

/* ================================================================
   CARD BOX
   ================================================================ */
.card-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(0,201,167,.18);
    border-radius: 20px;
    padding: 40px 36px 32px;
    box-shadow: 0 24px 64px rgba(0,0,0,.45);
    animation: cardFadeUp .45s ease both;
}

@keyframes cardFadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   CORNER BACK BUTTON (top-left — mirrors lang-dropdown on the right)
   ================================================================ */
.card-back-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(0,201,167,.4);
    background: rgba(0,201,167,.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00c9a7;
    font-size: 0.8rem;
    text-decoration: none;
    z-index: 10;
    transition: transform .2s, box-shadow .2s, background-color .2s;
}
.card-back-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0,201,167,.5);
    background-color: rgba(0,201,167,.15);
    color: #00c9a7;
}

/* back button always stays on the left regardless of direction */

/* ================================================================
   LOGO
   ================================================================ */
.card-logo {
    text-align: center;
    margin-bottom: 14px;
}
.card-logo-img {
    height: 52px;
    width: auto;
}

/* ================================================================
   TITLE & DESCRIPTION
   ================================================================ */
.card-title {
    margin: 0 0 16px;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: #d0e8f0;
}
.card-desc {
    font-size: 0.85rem;
    color: #8faab8;
    text-align: center;
    margin: 0 0 20px;
}

/* ================================================================
   ALERTS
   ================================================================ */
.card-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 18px;
}
.card-alert-error   { background: rgba(239,68,68,.15);  border: 1px solid rgba(239,68,68,.35);  color: #fca5a5; }
.card-alert-success { background: rgba(0,201,167,.12);  border: 1px solid rgba(0,201,167,.35);  color: #80cbc4; }
.card-alert-warning { background: rgba(255,193,7,.10);  border: 1px solid rgba(255,193,7,.30);  color: #fff9c4; }
.card-alert-info    { background: rgba(30,136,229,.12); border: 1px solid rgba(30,136,229,.35); color: #90caf9; }

/* ================================================================
   SECTION LABEL & DIVIDER
   ================================================================ */
.card-section-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #5a8a9a;
    letter-spacing: .6px;
    text-transform: uppercase;
    margin: 20px 0 12px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.card-section-label:first-child { margin-top: 0; }
.card-section-label i { font-size: 0.85rem; }

.card-section-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,.07);
    margin: 20px 0;
}

/* ================================================================
   FORM FIELDS
   ================================================================ */
.card-form { margin-bottom: 0; }

.card-field {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 12px;
    margin-bottom: 14px;
    transition: border-color .22s;
    overflow: hidden;
}
.card-field:focus-within {
    border-color: #00c9a7;
    background: rgba(0,201,167,.07);
}

.card-field-icon {
    width: 44px;
    text-align: center;
    flex-shrink: 0;
    color: #8faab8;
    font-size: 0.95rem;
}

.card-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.95rem;
    padding: 13px 12px;
    font-family: inherit;
}
.card-input::placeholder { color: #5a7a8a; }
html[dir="rtl"] .card-input::placeholder {
    direction: rtl;
    text-align: right;
    unicode-bidi: plaintext;
}

/* Textarea variant */
textarea.card-input {
    resize: vertical;
    min-height: 90px;
    white-space: normal;
    overflow: auto;
    padding: 12px;
    align-self: stretch;
    width: 100%;
}
.card-field:has(textarea) { align-items: flex-start; }
.card-field:has(textarea) .card-field-icon { padding-top: 13px; }

/* Readonly field */
.card-input[readonly] { opacity: .65; cursor: default; }

/* Date input — force dark color-scheme so browser controls stay visible */
.card-input[type="date"] {
    color-scheme: dark;
}

/* ================================================================
   PASSWORD TOGGLE
   ================================================================ */
.card-pw-wrap { padding-inline-end: 4px; }
.card-pw-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #8faab8;
    padding: 10px;
    font-size: 0.9rem;
    transition: color .2s;
    flex-shrink: 0;
}
.card-pw-toggle:hover { color: #00c9a7; }

/* ================================================================
   HINT TEXT
   ================================================================ */
.card-hint {
    margin: -4px 2px 12px;
    font-size: 0.78rem;
    color: #7e9eac;
}

/* ================================================================
   SUBMIT BUTTON
   ================================================================ */
.card-btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #00c9a7 0%, #0097a7 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    margin-top: 6px;
    transition: opacity .2s, transform .15s;
}
.card-btn:hover  { opacity: .88; }
.card-btn:active { transform: scale(.98); }

/* ================================================================
   STATUS BLOCK (verified / pending)
   ================================================================ */
.card-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 0;
    text-align: center;
}
.card-status-icon          { font-size: 52px; line-height: 1; }
.card-status-icon.verified { color: #00c9a7; }
.card-status-icon.pending  { color: #ffd54f; }
.card-status-title         { font-size: 16px; font-weight: 700; color: #fff; }
.card-status-text          { font-size: 13px; color: #8faab8; line-height: 1.6; }

/* ================================================================
   LINKS ROW
   ================================================================ */
.card-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.card-link {
    font-size: 0.85rem;
    color: #00c9a7;
    text-decoration: none;
    transition: opacity .2s;
}
.card-link:hover   { opacity: .75; }
.card-link-sep     { color: rgba(255,255,255,.2); }

/* Bottom back button — styled like an outlined pill button */
.card-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.14);
    background: transparent;
    color: #8faab8;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, border-color .2s, color .2s;
}
.card-back-link:hover {
    background: rgba(0,201,167,.08);
    border-color: rgba(0,201,167,.4);
    color: #00c9a7;
}

/* ================================================================
   WIDE VARIANT (profile edit — more fields)
   ================================================================ */
.card-box--wide {
    max-width: 480px;
}

/* ================================================================
   GENDER PILLS
   ================================================================ */
.card-gender-pills {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.card-gender-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.05);
    color: #8faab8;
    cursor: pointer;
    font-size: 0.92rem;
    transition: border-color .2s, background .2s, color .2s;
    user-select: none;
}
.card-gender-pill input[type="radio"] { display: none; }
.card-gender-pill.active,
.card-gender-pill:hover {
    border-color: rgba(0,201,167,.45);
    background: rgba(0,201,167,.1);
    color: #00c9a7;
}

/* ================================================================
   PHONE FIELD (intl-tel-input host)
   ================================================================ */
.card-phone-field { overflow: visible; padding: 0; }
.card-phone-field .iti { width: 100%; }
.card-phone-field .iti__selected-country {
    border-radius: 12px 0 0 12px;
    transition: background .2s;
    padding-inline: 10px;
}
.card-phone-field .iti__selected-country:hover { background: rgba(0,201,167,.12); }
.card-phone-field .iti__arrow { border-top-color: #7fb7c9; }
.card-phone-field .iti__arrow--up { border-bottom-color: #7fb7c9; }
.card-phone-field .iti__country-list {
    background: linear-gradient(180deg,#132536 0%,#0f1923 100%);
    border: 1px solid rgba(0,201,167,.28);
    color: #d0e8f0;
    border-radius: 12px;
    box-shadow: 0 16px 30px rgba(0,0,0,.32);
}
.card-phone-field .iti__search-input {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(0,201,167,.35);
    border-radius: 10px;
    color: #e5f6fb;
}
.card-phone-field .iti__search-input::placeholder { color: #7fa0ad; }
.card-phone-field .iti__country { color: #d0e8f0; }
.card-phone-field .iti__country:hover,
.card-phone-field .iti__country.iti__highlight { background: rgba(0,201,167,.16); }
.card-phone-field .iti__country.iti__active { background: rgba(0,201,167,.22); }
.card-phone-field .iti__dial-code { color: #8bb6c7; }
.card-phone-field .iti__divider { border-bottom-color: rgba(255,255,255,.1); }
.card-phone-field .iti__country-list::-webkit-scrollbar { width: 8px; }
.card-phone-field .iti__country-list::-webkit-scrollbar-thumb {
    background: rgba(0,201,167,.35);
    border-radius: 999px;
}
.card-phone-field .iti__country-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,.04);
}
.card-phone-field .card-input { padding-inline-start: 52px; }

/* intl-tel-input fullscreen popup (mobile — appended to <body>, must be global) */
.iti.iti--container.iti--fullscreen-popup {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0,0,0,.6);
}
.iti.iti--container.iti--fullscreen-popup .iti__country-list {
    background: linear-gradient(180deg, #132536 0%, #0f1923 100%);
    color: #d0e8f0;
    border: 1px solid rgba(0,201,167,.28);
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0,0,0,.35);
    width: min(560px, 100%);
    max-height: min(72vh, 560px);
}
.iti.iti--container.iti--fullscreen-popup .iti__search-input {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(0,201,167,.35);
    border-radius: 10px;
    color: #e5f6fb;
}
.iti.iti--container.iti--fullscreen-popup .iti__search-input::placeholder { color: #7fa0ad; }
.iti.iti--container.iti--fullscreen-popup .iti__country { color: #d0e8f0; }
.iti.iti--container.iti--fullscreen-popup .iti__country:hover,
.iti.iti--container.iti--fullscreen-popup .iti__country.iti__highlight {
    background: rgba(0,201,167,.16);
}
.iti.iti--container.iti--fullscreen-popup .iti__country.iti__active {
    background: rgba(0,201,167,.22);
}
.iti.iti--container.iti--fullscreen-popup .iti__dial-code { color: #8bb6c7; }
.iti.iti--container.iti--fullscreen-popup .iti__divider { border-bottom-color: rgba(255,255,255,.1); }

/* ================================================================
   LOCATION TOGGLE ROW
   ================================================================ */
.card-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    margin-bottom: 14px;
}
.card-toggle-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.card-toggle-label {
    font-size: 0.9rem;
    color: #cdd6e0;
    line-height: 1.4;
}
.card-toggle-switch {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 26px;
    cursor: pointer;
}
.card-toggle-switch input { display: none; }
.card-toggle-track {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.12);
    border-radius: 13px;
    transition: background .25s;
}
.card-toggle-switch input:checked ~ .card-toggle-track { background: #00c9a7; }
.card-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform .25s;
}
.card-toggle-switch input:checked ~ .card-toggle-track .card-toggle-thumb {
    transform: translateX(20px);
}

/* Keep phone field icon (iti flag) on the left even in RTL */
[dir="rtl"] .card-phone-field { flex-direction: row; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 480px) {
    .card-box,
    .card-box--wide {
        padding: 36px 16px 24px;
    }
    .card-field-icon { width: 40px; }
    .card-input { font-size: 0.9rem; }
}

/* ── DOB drum picker ────────────────────────────────────────────────────── */
.card-dob-wrap { margin-bottom: 14px; }
.card-dob-drums {
    display: flex;
    align-items: flex-start;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 14px;
    padding: 6px 10px 10px;
    transition: border-color .22s;
}
.card-dob-drums:focus-within {
    border-color: rgba(0,201,167,.45);
    background: rgba(0,201,167,.05);
}
.card-dob-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}
.card-dob-col--month { flex: 1.5; }
.card-dob-col--year  { flex: 1.6; }
.card-dob-sep {
    align-self: center;
    padding: 0 3px;
    color: rgba(255,255,255,.18);
    font-size: 1rem;
    user-select: none;
}
.card-dob-drum-wrap {
    position: relative;
    height: calc(32px * 3);
    width: 100%;
    overflow: hidden;
    cursor: ns-resize;
    -webkit-user-select: none;
    user-select: none;
}
.card-dob-drum-wrap::before {
    content: '';
    position: absolute;
    top: calc(50% - 16px);
    left: 2px; right: 2px;
    height: 32px;
    background: rgba(0,201,167,.1);
    border-top:    1px solid rgba(0,201,167,.35);
    border-bottom: 1px solid rgba(0,201,167,.35);
    border-radius: 7px;
    pointer-events: none;
    z-index: 2;
}
.card-dob-drum {
    position: relative;
    z-index: 1;
    will-change: transform;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 33%, black 67%, transparent 100%);
    mask-image:         linear-gradient(to bottom, transparent 0%, black 33%, black 67%, transparent 100%);
}
.card-dob-item {
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    font-family: inherit;
    color: rgba(255,255,255,.45);
    pointer-events: none;
    transition: color .12s;
}
.card-dob-item--sel {
    color: #00c9a7;
    font-weight: 600;
    font-size: 0.92rem;
}
.card-dob-wrap--locked .card-dob-drums {
    opacity: .65;
    pointer-events: none;
    border-color: rgba(255,255,255,.07);
    background: rgba(255,255,255,.02);
}
.card-dob-wrap--locked .card-dob-item--sel {
    color: #8faab8;
}

/* ================================================================
   LEGAL PAGE VARIANT (wider card, top-aligned for long content)
   ================================================================ */
.card-page--legal {
    align-items: flex-start;
    padding-top: 56px;
    padding-bottom: 56px;
}

.card-box--legal {
    max-width: 680px;
}

/* ================================================================
   PAGE ICON HEADER (legal / info pages)
   ================================================================ */
.card-page-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    text-align: center;
}

.card-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    flex-shrink: 0;
}

.card-icon--teal   { background: linear-gradient(135deg, #00c9a7 0%, #0097a7 100%); box-shadow: 0 4px 20px rgba(0,201,167,.35); }
.card-icon--blue   { background: linear-gradient(135deg, #1e88e5 0%, #0d47a1 100%); box-shadow: 0 4px 20px rgba(30,136,229,.35); }
.card-icon--purple { background: linear-gradient(135deg, #7c4dff 0%, #5e35b1 100%); box-shadow: 0 4px 20px rgba(124,77,255,.35); }

.card-page-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.card-page-subtitle {
    font-size: 13px;
    color: #8faab8;
    margin: 0;
}

/* ================================================================
   LEGAL CONTENT STYLES
   ================================================================ */
.legal-section {
    margin-bottom: 22px;
}

.legal-section:last-child { margin-bottom: 0; }

.legal-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #00c9a7;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legal-section-body {
    font-size: 13.5px;
    color: #8faab8;
    line-height: 1.75;
}

.legal-section-body ul {
    padding-inline-start: 20px;
    margin: 6px 0 0;
}

.legal-section-body li { margin-bottom: 4px; }

.legal-section-body strong { color: #cce8e2; }

.legal-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,.07);
    margin: 0 0 22px;
}

.legal-effective-date {
    font-size: 12px;
    color: #4a6070;
    text-align: center;
    margin-bottom: 20px;
}

@media (max-width: 480px) {
    .card-page--legal { padding-top: 36px; padding-bottom: 36px; }
    .card-box--legal  { padding: 36px 16px 24px; }
}

/* ================================================================
   ACCOUNT VERIFICATION SECTION
   ================================================================ */
.card-verification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.card-verification-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.card-verification-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(255,255,255,.08);
    flex-shrink: 0;
}

.card-verification-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #e5f6fb;
    margin-bottom: 2px;
}

.card-verification-desc {
    font-size: 0.8rem;
    color: #7fa0ad;
    line-height: 1.3;
}

.card-verification-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(0,201,167,.08);
    border: 1px solid rgba(0,201,167,.28);
    border-radius: 8px;
    color: #00c9a7;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .22s;
    flex-shrink: 0;
}

.card-verification-btn:hover {
    background: rgba(0,201,167,.15);
    border-color: rgba(0,201,167,.45);
    transform: translateY(-1px);
}

.card-verification-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: rgba(0,201,167,.12);
    border-radius: 999px;
    color: #00c9a7;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .card-verification-item {
        flex-direction: column;
        align-items: stretch;
    }

    .card-verification-btn,
    .card-verification-badge {
        justify-content: center;
        width: 100%;
    }
}

/* ================================================================
   LINK SOCIAL ACCOUNT BUTTON
   ================================================================ */
.card-link-social-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    margin-bottom: 14px;
    text-decoration: none;
    transition: all .22s;
    cursor: pointer;
}

.card-link-social-btn:hover {
    background: rgba(255,255,255,.07);
    border-color: rgba(255,255,255,.15);
    transform: translateY(-1px);
}

.card-link-social-btn--facebook:hover {
    background: rgba(24, 119, 242, .08);
    border-color: rgba(24, 119, 242, .3);
}

.card-link-social-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.card-link-social-btn--facebook .card-link-social-icon {
    background: rgba(24, 119, 242, .15);
    color: #1877F2;
}

.card-link-social-info {
    flex: 1;
    min-width: 0;
}

.card-link-social-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #e5f6fb;
    margin-bottom: 2px;
}

.card-link-social-desc {
    font-size: 0.8rem;
    color: #7fa0ad;
    line-height: 1.3;
}

.card-link-social-arrow {
    font-size: 0.9rem;
    color: #7fa0ad;
    flex-shrink: 0;
    transition: transform .22s;
}

.card-link-social-btn:hover .card-link-social-arrow {
    transform: translateX(3px);
}

@media (max-width: 480px) {
    .card-link-social-btn {
        padding: 12px 14px;
    }
}
