/* ============================================================
   profile.css — Vertex IS | Profile Page
   Aesthetic: Dark luxury editorial with gold accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Syne:wght@400;500;600;700;800&family=DM+Mono:wght@300;400;500&display=swap');

/* ── CSS Variables ── */

:root {
    --purple: #1E0038;
    --purple-mid: #310052;
    --purple-light: #4a0078;
    --purple-glow: rgba(49, 0, 82, 0.6);
    --gold: #E8B000;
    --gold-light: #F5C842;
    /* --gold-pale: rgba(232, 176, 0, 0.12); */
    /* --gold-border: rgba(232, 176, 0, 0.35); */
    --white: #ffffff;
    --off-white: #FAF8FF;
    --light: #F3F0FA;
    --muted: #6b6880;
    --dark-text: #1a1325;
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2.25rem;
    --radius-pill: 100px;
    --shadow-sm: 0 2px 12px rgba(30, 0, 56, 0.08);
    --shadow-md: 0 8px 32px rgba(30, 0, 56, 0.12);
    --shadow-lg: 0 20px 60px rgba(30, 0, 56, 0.18);
    --shadow-gold: 0 8px 32px rgba(232, 176, 0, 0.25);
    --transition: 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ── Reset & Base ── */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.profile-page-wrapper {
    min-height: 100vh;
    background: var(--cream);
    background-image: radial-gradient(ellipse 80% 60% at 70% -10%, rgba(49, 0, 82, 0.06) 0%, transparent 60%), radial-gradient(ellipse 50% 40% at -5% 80%, rgba(201, 168, 76, 0.04) 0%, transparent 50%);
    padding: 60px 20px 100px;
    font-family: var(--font-ui);
}


/* ── Layout ── */

.profile-container {
    max-width: 680px;
    margin: 0 auto;
}


/* ── Header Block ── */

.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    animation: fadeSlideUp 0.6s ease both;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mid-plum) 0%, var(--rich-violet) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 0 0 3px var(--cream), 0 0 0 5px var(--border-gold);
}

.profile-avatar::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: conic-gradient( from 0deg, var(--gold) 0deg 60deg, transparent 60deg 180deg, var(--gold-light) 180deg 240deg, transparent 240deg 360deg);
    z-index: -1;
    opacity: 0.5;
    animation: spin 12s linear infinite;
}

.profile-avatar-initials {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 300;
    color: var(--gold-light);
    letter-spacing: 1px;
    font-style: italic;
}

.profile-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 600;
    color: var(--deep-plum);
    line-height: 1.1;
    letter-spacing: -0.3px;
}

.profile-title em {
    font-style: italic;
    font-weight: 300;
    color: var(--gold);
}

.profile-subtitle {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 4px;
}


/* ── Card ── */

.profile-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    animation: fadeSlideUp 0.7s ease 0.1s both;
}


/* ── Card Sections ── */

.card-section {
    padding: 36px 40px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.card-section:last-of-type {
    border-bottom: none;
}

.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.section-label-text {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.section-label-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-gold), transparent);
}

.section-label-icon {
    width: 28px;
    height: 28px;
    background: var(--off-white);
    border: 1px solid var(--border-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 13px;
}


/* ── Form Fields ── */

.field-group {
    margin-bottom: 22px;
}

.field-group:last-child {
    margin-bottom: 0;
}

.field-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    transition: color var(--transition);
}

.field-wrapper {
    position: relative;
}

.field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
    transition: color var(--transition);
    z-index: 1;
}

.profile-input {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 44px;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    color: var(--deep-plum);
    background: var(--off-white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.profile-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.profile-input:focus {
    background: #fff;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.profile-input:focus+.field-focus-bar {
    transform: scaleX(1);
}

.profile-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(26, 0, 48, 0.03);
}

.field-wrapper:focus-within .field-icon {
    color: var(--gold);
}

.field-wrapper:focus-within+.field-label {
    color: var(--gold);
}

.field-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    padding-left: 2px;
    font-family: var(--font-mono);
}


/* ── Password strength ── */

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 16px;
    padding: 4px;
    transition: color var(--transition);
    z-index: 2;
}

.password-toggle:hover {
    color: var(--gold);
}

.profile-input.has-toggle {
    padding-right: 46px;
}

.strength-bar {
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.4s ease, background-color 0.4s ease;
}

.strength-fill.weak {
    width: 33%;
    background: #e05a4e;
}

.strength-fill.medium {
    width: 66%;
    background: var(--gold);
}

.strength-fill.strong {
    width: 100%;
    background: #4caf7d;
}

.strength-text {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 1px;
}


/* ── Alerts ── */

.profile-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    margin: 0 40px 0;
    animation: alertSlide 0.4s ease both;
}

.profile-alert+.card-section {
    border-top: none;
}

.profile-alert:first-child {
    margin-top: 28px;
}

.profile-alert-success {
    background: rgba(76, 175, 125, 0.08);
    border: 1px solid rgba(76, 175, 125, 0.3);
    color: #2d7a56;
}

.profile-alert-error {
    background: rgba(224, 90, 78, 0.08);
    border: 1px solid rgba(224, 90, 78, 0.3);
    color: #b83e35;
}

.alert-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}


/* ── Buttons ── */

.btn-area {
    padding: 28px 40px 36px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-profile-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--deep-plum);
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 60%, var(--gold) 100%);
    background-size: 200% 100%;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-profile-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.btn-profile-primary:hover {
    background-position: right center;
    box-shadow: 0 6px 30px rgba(201, 168, 76, 0.45);
    transform: translateY(-1px);
}

.btn-profile-primary:hover::before {
    transform: translateX(100%);
}

.btn-profile-primary:active {
    transform: translateY(0);
}

.btn-profile-primary .btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(26, 0, 48, 0.2);
    border-top-color: var(--deep-plum);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.btn-profile-primary.loading .btn-text {
    display: none;
}

.btn-profile-primary.loading .btn-spinner {
    display: block;
}

.btn-profile-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-profile-secondary:hover {
    border-color: var(--border-gold);
    color: var(--gold);
    background: rgba(201, 168, 76, 0.04);
}


/* ── Username badge ── */

.username-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--off-white);
    border: 1px solid var(--border-gold);
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--deep-plum);
    margin-top: 4px;
}

.username-badge-at {
    color: var(--gold);
    font-weight: 500;
}

.username-lock {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
}


/* ── Divider ── */

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-gold), transparent);
    margin: 0;
}


/* ── Back link ── */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 28px;
    transition: color var(--transition);
    animation: fadeSlideUp 0.5s ease both;
}

.back-link:hover {
    color: var(--gold);
}

.back-link i {
    font-size: 13px;
}


/* ── Row layout for fields ── */

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 540px) {
    .field-row {
        grid-template-columns: 1fr;
    }
    .card-section {
        padding: 28px 24px;
    }
    .btn-area {
        padding: 24px 24px 32px;
    }
    .profile-alert {
        margin: 0 24px;
    }
    .profile-title {
        font-size: 26px;
    }
}


/* ── Animations ── */

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* ── Decorative corner mark on card ── */

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(ellipse at top right, rgba(201, 168, 76, 0.07), transparent 70%);
    border-radius: 0 var(--radius-lg) 0 0;
    pointer-events: none;
}


/* ── Focus visible for accessibility ── */

.profile-input:focus-visible,
.btn-profile-primary:focus-visible,
.btn-profile-secondary:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}