/*
 * ============================================================
 *  AgentSeeker Identity Pages
 *  Glass-styled login, register, and account management
 *  Built on design-tokens.css + glass-components.css
 * ============================================================
 */

/* ---- Page base ---- */
.identity-page {
    min-height: 100vh;
    background: var(--gradient-hero, linear-gradient(125deg, #E8D4B4 0%, #DDD0E0 30%, #BEC8DC 60%, #A0BAD2 100%));
    background-attachment: fixed;
    font-family: var(--font-body, 'Outfit', sans-serif);
    color: var(--text, #2E3530);
    display: flex;
    flex-direction: column;
}

/* ---- Top navigation bar ---- */
.identity-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2.5rem;
    position: relative;
    z-index: 10;
}

.identity-nav-logo {
    height: 22px;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.identity-nav-logo:hover {
    opacity: 1;
}

.identity-nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.identity-nav-links a {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text, #2E3530);
    padding: 7px 18px;
    border-radius: var(--radius-pill, 50px);
    transition: all 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.identity-nav-links a:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--accent-dark, #1A1F1C);
}

.identity-nav-links .id-nav-highlight {
    background: var(--glass-ghost, rgba(255, 255, 255, 0.18));
    backdrop-filter: blur(22px) saturate(1.8);
    -webkit-backdrop-filter: blur(22px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: var(--text, #2E3530);
}

.identity-nav-links .id-nav-highlight:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* ---- Content area ---- */
.identity-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem 4rem;
}

/* ---- Glass form card ---- */
.identity-card {
    width: 100%;
    max-width: 440px;
    background: var(--glass-card, rgba(255, 255, 255, 0.18));
    backdrop-filter: var(--glass-blur, blur(26px) saturate(1.6));
    -webkit-backdrop-filter: var(--glass-blur, blur(26px) saturate(1.6));
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: var(--radius-xl, 28px);
    padding: 2.5rem 2.25rem;
    box-shadow:
        var(--shadow, 0 8px 40px rgba(26, 31, 28, 0.07)),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
    position: relative;
    overflow: hidden;
    animation: cardEntrance 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Specular top edge */
.identity-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 6%;
    right: 6%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.9) 30%,
        rgba(255, 255, 255, 0.9) 70%,
        transparent);
    pointer-events: none;
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---- Card title ---- */
.identity-card-title {
    font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--accent-dark, #1A1F1C);
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
}

.identity-card-subtitle {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-light, #8A9890);
    margin-bottom: 2rem;
}

/* ---- Form fields ---- */
.identity-card .form-floating {
    margin-bottom: 1rem;
    position: relative;
}

.identity-card .form-floating .form-control {
    width: 100%;
    padding: 1.25rem 1rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-md, 18px);
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.88rem;
    color: var(--text, #2E3530);
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.3);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    height: auto;
    min-height: 3.25rem;
}

.identity-card .form-floating .form-control:hover {
    background: rgba(255, 255, 255, 0.32);
    border-color: rgba(255, 255, 255, 0.7);
}

.identity-card .form-floating .form-control:focus {
    border-color: rgba(195, 160, 95, 0.5);
    outline: none;
    box-shadow:
        0 0 0 3px rgba(195, 160, 95, 0.1),
        inset 0 0 0 0.5px rgba(255, 215, 140, 0.3);
    background: rgba(255, 255, 255, 0.35);
}

.identity-card .form-floating .form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.identity-card .form-floating > label {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.82rem;
    font-weight: 300;
    color: var(--text-light, #8A9890);
    padding: 0.85rem 1rem;
    transition: all 0.2s ease;
    pointer-events: none;
}

/* ---- Checkbox ---- */
.identity-card .form-check-input {
    width: 16px;
    height: 16px;
    border: 1.5px solid rgba(195, 160, 95, 0.4);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    top: 2px;
    margin-right: 0.5rem;
}

.identity-card .form-check-input:checked {
    background: var(--primary, #C3A05F);
    border-color: var(--primary, #C3A05F);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.identity-card .checkbox label,
.identity-card .form-check label {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.82rem;
    font-weight: 300;
    color: var(--text, #2E3530);
    cursor: pointer;
    user-select: none;
}

/* ---- Submit button ---- */
.identity-card .btn-primary,
.identity-card .id-btn {
    width: 100%;
    padding: 0.85rem 1.5rem;
    border: 1px solid rgba(230, 200, 150, 0.5);
    border-radius: var(--radius-pill, 50px);
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2A2018;
    background: rgba(210, 175, 115, 0.25);
    backdrop-filter: blur(22px) saturate(1.8);
    -webkit-backdrop-filter: blur(22px) saturate(1.8);
    box-shadow:
        0 4px 24px rgba(200, 160, 90, 0.15),
        inset 0 0 0 0.5px rgba(255, 220, 160, 0.25);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
    position: relative;
    overflow: hidden;
    margin-top: 0.75rem;
}

.identity-card .btn-primary:hover,
.identity-card .id-btn:hover {
    background: rgba(210, 175, 115, 0.38);
    border-color: rgba(230, 200, 150, 0.7);
    box-shadow:
        0 6px 28px rgba(200, 160, 90, 0.22),
        inset 0 0 0 0.5px rgba(255, 220, 160, 0.35);
    transform: translateY(-1px);
}

.identity-card .btn-primary:active,
.identity-card .id-btn:active {
    transform: translateY(0);
    opacity: 0.9;
}

/* Glare sweep on button */
.identity-card .btn-primary::after,
.identity-card .id-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 20%,
        rgba(255, 255, 255, 0.1) 35%,
        rgba(255, 220, 180, 0.15) 45%,
        rgba(255, 255, 255, 0.1) 55%,
        transparent 70%
    );
    pointer-events: none;
}

.identity-card .btn-primary:hover::after,
.identity-card .id-btn:hover::after {
    animation: glassGlare 0.6s ease-out forwards;
}

/* ---- Links ---- */
.identity-card a {
    color: var(--primary-dark, #8A7040);
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.82rem;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.2s ease;
}

.identity-card a:hover {
    color: var(--primary, #C3A05F);
}

.identity-links {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* ---- Validation errors ---- */
.identity-card .text-danger {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--error, #A05028);
    margin-top: 0.25rem;
    display: block;
}

/* ---- Divider ---- */
.identity-divider {
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(195, 160, 95, 0.25) 20%,
        rgba(195, 160, 95, 0.25) 80%,
        transparent);
    border: none;
    margin: 1.5rem 0;
}

/* ============================================================
 *  MANAGE / ACCOUNT PAGES
 * ============================================================ */

.identity-manage {
    width: 100%;
    max-width: 820px;
}

.identity-manage-header {
    margin-bottom: 2rem;
}

.identity-manage-title {
    font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--accent-dark, #1A1F1C);
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.identity-manage-subtitle {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.82rem;
    font-weight: 300;
    color: var(--text-light, #8A9890);
}

/* Manage layout — side nav + content */
.identity-manage-body {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

/* Side navigation */
.identity-manage-nav {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.identity-manage-nav .nav-link {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text, #2E3530);
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-sm, 14px);
    text-decoration: none;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.identity-manage-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--accent-dark, #1A1F1C);
}

.identity-manage-nav .nav-link.active {
    background: rgba(195, 160, 95, 0.15);
    border-color: rgba(195, 160, 95, 0.3);
    color: var(--primary-dark, #8A7040);
    font-weight: 500;
}

/* Manage content panel */
.identity-manage-panel {
    flex: 1;
    min-width: 0;
    background: var(--glass-card, rgba(255, 255, 255, 0.18));
    backdrop-filter: var(--glass-blur, blur(26px) saturate(1.6));
    -webkit-backdrop-filter: var(--glass-blur, blur(26px) saturate(1.6));
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: var(--radius-xl, 28px);
    padding: 2rem 2rem;
    box-shadow:
        var(--shadow, 0 8px 40px rgba(26, 31, 28, 0.07)),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
    position: relative;
    overflow: hidden;
}

.identity-manage-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 6%;
    right: 6%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.9) 30%,
        rgba(255, 255, 255, 0.9) 70%,
        transparent);
    pointer-events: none;
}

.identity-manage-panel h3 {
    font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--accent-dark, #1A1F1C);
    margin-bottom: 1.25rem;
}

/* Reuse identity-card form styles inside manage panel */
.identity-manage-panel .form-floating {
    margin-bottom: 1rem;
}

.identity-manage-panel .form-floating .form-control {
    width: 100%;
    padding: 1.25rem 1rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-md, 18px);
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.88rem;
    color: var(--text, #2E3530);
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.3);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    height: auto;
    min-height: 3.25rem;
}

.identity-manage-panel .form-floating .form-control:hover {
    background: rgba(255, 255, 255, 0.32);
    border-color: rgba(255, 255, 255, 0.7);
}

.identity-manage-panel .form-floating .form-control:focus {
    border-color: rgba(195, 160, 95, 0.5);
    outline: none;
    box-shadow:
        0 0 0 3px rgba(195, 160, 95, 0.1),
        inset 0 0 0 0.5px rgba(255, 215, 140, 0.3);
    background: rgba(255, 255, 255, 0.35);
}

.identity-manage-panel .form-floating .form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.identity-manage-panel .form-floating > label {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.82rem;
    font-weight: 300;
    color: var(--text-light, #8A9890);
    padding: 0.85rem 1rem;
}

.identity-manage-panel .btn-primary {
    width: 100%;
    max-width: 280px;
    padding: 0.75rem 1.5rem;
    border: 1px solid rgba(230, 200, 150, 0.5);
    border-radius: var(--radius-pill, 50px);
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2A2018;
    background: rgba(210, 175, 115, 0.25);
    backdrop-filter: blur(22px) saturate(1.8);
    -webkit-backdrop-filter: blur(22px) saturate(1.8);
    box-shadow:
        0 4px 24px rgba(200, 160, 90, 0.15),
        inset 0 0 0 0.5px rgba(255, 220, 160, 0.25);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
    margin-top: 0.5rem;
}

.identity-manage-panel .btn-primary:hover {
    background: rgba(210, 175, 115, 0.38);
    border-color: rgba(230, 200, 150, 0.7);
    transform: translateY(-1px);
}

.identity-manage-panel .text-danger {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.72rem;
    color: var(--error, #A05028);
}

/* The default Identity pages (Email, Password, Personal data) wrap their forms in a Bootstrap
   .row > .col-md-6. Inside the glass panel that halves the width — truncating the email value
   and wrapping the floating labels into tiny pills. Force full width so the fields read properly. */
.identity-manage-panel .row { margin-left: 0; margin-right: 0; }
.identity-manage-panel [class*="col-"] { flex: 0 0 100%; max-width: 100%; padding-left: 0; padding-right: 0; }
.identity-manage-panel .form-floating > label { white-space: nowrap; }

/* The "email confirmed" tick sits in a Bootstrap .input-group — align it beside the glass field. */
.identity-manage-panel .input-group { display: flex; align-items: stretch; gap: 8px; flex-wrap: nowrap; }
.identity-manage-panel .input-group .form-floating { flex: 1 1 auto; margin-bottom: 0; }
.identity-manage-panel .input-group-text {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-md, 18px);
    background: rgba(123, 176, 123, 0.18);
    color: #4f7a4f;
    font-weight: 600;
}

/* Destructive action (Delete personal data) — match the primary pill, danger-tinted, not raw red. */
.identity-manage-panel .btn-danger {
    width: auto;
    padding: 0.7rem 1.6rem;
    margin-top: 0.5rem;
    border: 1px solid rgba(180, 80, 60, 0.5);
    border-radius: var(--radius-pill, 50px);
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7a2418;
    background: rgba(200, 90, 70, 0.16);
    backdrop-filter: blur(22px) saturate(1.6);
    -webkit-backdrop-filter: blur(22px) saturate(1.6);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.identity-manage-panel .btn-danger:hover {
    background: rgba(200, 90, 70, 0.28);
    border-color: rgba(180, 80, 60, 0.7);
    transform: translateY(-1px);
}

/* ---- Status message ---- */
.identity-status-message {
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.82rem;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm, 14px);
    margin-bottom: 1rem;
    background: rgba(122, 144, 136, 0.12);
    border: 1px solid rgba(122, 144, 136, 0.25);
    color: var(--success, #7A9088);
}

/* ---- Footer ---- */
.identity-footer {
    text-align: center;
    padding: 1.5rem 2rem;
    font-family: var(--font-body, 'Outfit', sans-serif);
    font-size: 0.7rem;
    font-weight: 300;
    color: var(--text-light, #8A9890);
    letter-spacing: 0.04em;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .identity-nav {
        padding: 0.75rem 1.25rem;
    }

    .identity-card {
        padding: 2rem 1.5rem;
        border-radius: 22px;
    }

    .identity-manage-body {
        flex-direction: column;
    }

    .identity-manage-nav {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .identity-manage-nav .nav-link {
        font-size: 0.72rem;
        padding: 0.45rem 0.8rem;
    }

    .identity-manage-panel {
        padding: 1.5rem 1.25rem;
        border-radius: 22px;
    }
}
