/**
 * ==============================================================================
 * SADRA VISUALS — ARTBOOK PHOTOGRAPHY GALLERY & STUDIO CMS
 * LAYER 7.3: CLIENT GATEKEEPER PASSCODE MODAL & ACCESS SHIELD STYLES
 * ==============================================================================
 * Styles for:
 * 1. Glassmorphic Modal Backdrop & Lock Card (.gatekeeper-modal-backdrop)
 * 2. Mobile Bottom-Sheet Ergonomics (< 768px, < 480px, Safe Area Insets)
 * 3. Touch Ergonomics (>= 44px Tap Targets, >= 16px Input Font Size)
 * 4. Error Alert Banner & Shake Feedback Animation (.is-shaking)
 * 5. Dual-Theme Artbook Aesthetics (Obsidian & Gallery Light Modes)
 *
 * Canonical Base: https://gallery.sadra.at
 */

/* ------------------------------------------------------------------------------
   1. Glassmorphic Modal Backdrop & Card Container
   ------------------------------------------------------------------------------ */
.gatekeeper-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 10, 14, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: var(--z-modal, 1000);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px;
    box-sizing: border-box;
}

.gatekeeper-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.gatekeeper-modal-card {
    background: rgba(14, 18, 28, 0.97);
    border: 1px solid rgba(212, 175, 55, 0.38);
    border-radius: var(--radius-lg, 18px);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px -8px rgba(0, 0, 0, 0.8), 0 0 35px rgba(212, 175, 55, 0.15);
    overflow: hidden;
    transform: scale(0.96) translateY(12px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    box-sizing: border-box;
}

.gatekeeper-modal-backdrop.is-open .gatekeeper-modal-card {
    transform: scale(1) translateY(0);
}

/* Shake Animation on Passcode Verification Failure */
.gatekeeper-modal-card.is-shaking {
    animation: gatekeeperShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes gatekeeperShake {

    10%,
    90% {
        transform: scale(1) translate3d(-3px, 0, 0);
    }

    20%,
    80% {
        transform: scale(1) translate3d(4px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: scale(1) translate3d(-5px, 0, 0);
    }

    40%,
    60% {
        transform: scale(1) translate3d(5px, 0, 0);
    }
}

/* Mobile Bottom-Sheet Handle */
.gatekeeper-sheet-handle {
    display: none;
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 9999px;
    margin: 10px auto 4px;
    flex-shrink: 0;
}

/* ------------------------------------------------------------------------------
   2. Modal Header & Lock Badge
   ------------------------------------------------------------------------------ */
.gatekeeper-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    flex-shrink: 0;
    gap: 16px;
}

.gatekeeper-modal-title-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.gatekeeper-lock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--accent-gold, #d4af37);
    margin-bottom: 6px;
    flex-shrink: 0;
}

.gatekeeper-lock-icon {
    width: 20px;
    height: 20px;
}

.gatekeeper-modal-title-group h2 {
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--text-primary, #f8fafc);
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.gatekeeper-modal-title-group p {
    font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.85rem;
    color: var(--text-dim, #94a3b8);
    margin: 0;
    line-height: 1.45;
}

/* Modal Close Button */
.gatekeeper-modal-close-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    color: var(--text-muted, #94a3b8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
    box-sizing: border-box;
}

.gatekeeper-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary, #f8fafc);
}

.gatekeeper-modal-close-btn:active {
    transform: scale(0.94);
}

/* ------------------------------------------------------------------------------
   3. Modal Scrollable Body & Alert Banner
   ------------------------------------------------------------------------------ */
.gatekeeper-modal-body {
    padding: 22px 24px 26px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-sizing: border-box;
}

/* Alert Banner (Error / Rate Limit) */
.gatekeeper-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md, 10px);
    font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.85rem;
    line-height: 1.4;
    box-sizing: border-box;
    transition: opacity 0.2s ease;
}

.gatekeeper-alert-error {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.gatekeeper-alert-rate-limit {
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}

.gatekeeper-alert-icon {
    font-size: 1.05rem;
    flex-shrink: 0;
}

.gatekeeper-alert-msg {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Active Session Badge */
.gatekeeper-session-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 8px 14px;
    border-radius: var(--radius-md, 10px);
    font-size: 0.84rem;
    box-sizing: border-box;
    max-width: 100%;
}

.session-badge-label {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.76rem;
    color: var(--accent-gold, #d4af37);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.session-badge-title {
    font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
    color: var(--text-primary, #f8fafc);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ------------------------------------------------------------------------------
   4. Passcode Form & Inputs (Ergonomic Tap Targets & 16px Font Size)
   ------------------------------------------------------------------------------ */
.gatekeeper-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    box-sizing: border-box;
}

.gatekeeper-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.gatekeeper-form-label {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary, #cbd5e1);
}

.gatekeeper-input-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.gatekeeper-form-input {
    width: 100%;
    height: 48px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.15));
    border-radius: var(--radius-md, 10px);
    padding: 12px 48px 12px 16px;
    font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
    font-size: 1rem;
    /* >= 16px to prevent iOS Safari auto-zoom */
    color: var(--text-primary, #f8fafc);
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.gatekeeper-form-input:focus {
    border-color: var(--accent-gold, #d4af37);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
    background: rgba(255, 255, 255, 0.07);
}

.gatekeeper-form-input::placeholder {
    color: var(--text-dim, #64748b);
    font-size: 0.92rem;
}

/* 5-Cell Segmented OTP Input Layout */
.gatekeeper-otp-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 2vw, 12px);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 10px 0 6px;
}

.gatekeeper-otp-cell {
    width: clamp(42px, 14vw, 56px);
    height: clamp(50px, 14vw, 58px);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.16));
    border-radius: var(--radius-md, 10px);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 1.35rem;
    /* >= 16px to prevent iOS auto-zoom */
    font-weight: 700;
    text-align: center;
    color: var(--text-primary, #f8fafc);
    box-sizing: border-box;
    outline: none;
    padding: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.gatekeeper-otp-cell:focus {
    border-color: var(--accent-gold, #d4af37);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.28), 0 0 16px rgba(212, 175, 55, 0.12);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.gatekeeper-otp-cell.is-filled {
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(212, 175, 55, 0.05);
}

.gatekeeper-otp-cell.is-error,
.gatekeeper-modal-card.is-shaking .gatekeeper-otp-cell {
    border-color: var(--accent-rose, #f43f5e) !important;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.25) !important;
    background: rgba(244, 63, 94, 0.06) !important;
}

[data-theme="light"] .gatekeeper-otp-cell {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.15);
    color: #0f172a;
}

[data-theme="light"] .gatekeeper-otp-cell:focus {
    border-color: #b45309;
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.2);
    background: #ffffff;
}

/* Password Toggle Eye Button */
.gatekeeper-toggle-pw-btn {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: var(--text-dim, #94a3b8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
}

.gatekeeper-toggle-pw-btn:hover {
    color: var(--text-primary, #f8fafc);
    background: rgba(255, 255, 255, 0.06);
}

.gatekeeper-toggle-pw-btn svg {
    width: 18px;
    height: 18px;
}

/* Submit Action Button */
.gatekeeper-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
    width: 100%;
}

.gatekeeper-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    min-height: 44px;
    background: linear-gradient(135deg, var(--accent-gold, #d4af37), #b89326);
    color: #08090c;
    border: none;
    border-radius: var(--radius-md, 10px);
    font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35);
    box-sizing: border-box;
}

.gatekeeper-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45);
}

.gatekeeper-submit-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.25);
}

.gatekeeper-submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Button Spinner */
.gatekeeper-btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(8, 9, 12, 0.25);
    border-top-color: #08090c;
    border-radius: 50%;
    animation: gatekeeperSpin 0.7s linear infinite;
    display: inline-block;
}

@keyframes gatekeeperSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ------------------------------------------------------------------------------
   5. Dual-Theme Light Mode Support ([data-theme="light"])
   ------------------------------------------------------------------------------ */
[data-theme="light"] .gatekeeper-modal-backdrop {
    background: rgba(15, 23, 42, 0.6);
}

[data-theme="light"] .gatekeeper-modal-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2), 0 0 30px rgba(212, 175, 55, 0.12);
}

[data-theme="light"] .gatekeeper-modal-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .gatekeeper-modal-title-group h2 {
    color: #0f172a;
}

[data-theme="light"] .gatekeeper-modal-title-group p {
    color: #64748b;
}

[data-theme="light"] .gatekeeper-modal-close-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: #64748b;
}

[data-theme="light"] .gatekeeper-modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #0f172a;
}

[data-theme="light"] .gatekeeper-form-input {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.14);
    color: #0f172a;
}

[data-theme="light"] .gatekeeper-form-input:focus {
    background: #ffffff;
}

[data-theme="light"] .gatekeeper-toggle-pw-btn {
    color: #64748b;
}

[data-theme="light"] .gatekeeper-toggle-pw-btn:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .gatekeeper-session-badge {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
}

[data-theme="light"] .session-badge-title {
    color: #0f172a;
}

/* ------------------------------------------------------------------------------
   6. Mobile-First & Responsiveness Hardening (< 768px, < 480px, Safe Area Insets)
   ------------------------------------------------------------------------------ */
@media (max-width: 768px) {
    .gatekeeper-modal-backdrop {
        padding: 0;
        align-items: flex-end;
    }

    .gatekeeper-modal-card {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 22px 22px 0 0;
        border-bottom: none;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .gatekeeper-sheet-handle {
        display: block;
    }

    .gatekeeper-modal-header {
        padding: 16px 20px 14px;
    }

    .gatekeeper-modal-body {
        padding: 16px 20px 20px;
    }
}


@media (max-width: 480px) {
    .gatekeeper-modal-title-group h2 {
        font-size: 1.15rem;
    }

    .gatekeeper-modal-title-group p {
        font-size: 0.8rem;
    }

    .gatekeeper-modal-close-btn {
        width: 40px;
        height: 40px;
    }

    .gatekeeper-lock-badge {
        width: 34px;
        height: 34px;
    }

    .gatekeeper-lock-icon {
        width: 18px;
        height: 18px;
    }
}

/* ------------------------------------------------------------------------------
   7. Dedicated Client Portal Page & Proofing Workflow (.client-portal-*)
   ------------------------------------------------------------------------------ */
.client-portal-wrap {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;
    padding: 10px 16px 80px;
    box-sizing: border-box;
}

.client-portal-gate-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

.client-portal-gate-card {
    max-width: 480px;
    width: 100%;
    background: rgba(14, 18, 28, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 20px;
    padding: 36px 30px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 32px rgba(212, 175, 55, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    text-align: center;
    box-sizing: border-box;
}

.client-portal-gate-card.is-shaking {
    animation: gatekeeperShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.client-portal-badge {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--accent-gold, #d4af37);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
}

.client-portal-gate-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 8px;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    letter-spacing: -0.02em;
}

.client-portal-gate-desc {
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0 0 22px;
}

.client-portal-session-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.28);
    color: #38bdf8;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 9999px;
    margin-bottom: 20px;
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}

.client-portal-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
}

.client-portal-input {
    width: 100%;
    height: 50px;
    background: rgba(8, 10, 16, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 0 48px 0 16px;
    color: #f8fafc;
    font-size: 16px;
    /* Prevents iOS auto-zoom */
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.client-portal-input:focus {
    outline: none;
    border-color: var(--accent-gold, #d4af37);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.client-portal-toggle-pw {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.15s;
}

.client-portal-toggle-pw:hover {
    color: #f1f5f9;
}

.client-portal-submit-btn {
    width: 100%;
    min-height: 48px;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    color: #08090c;
    font-weight: 700;
    font-size: 0.94rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s, box-shadow 0.15s;
    letter-spacing: 0.02em;
}

.client-portal-submit-btn:hover {
    box-shadow: 0 4px 18px rgba(212, 175, 55, 0.35);
}

.client-portal-alert {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 10px 14px;
    color: #fca5a5;
    font-size: 0.84rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    box-sizing: border-box;
    word-break: break-word;
}

/* Active Client Session View */
.client-portal-session-view {
    width: 100%;
    box-sizing: border-box;
    animation: fadeInView 0.35s ease;
}

@keyframes fadeInView {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.client-portal-session-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    background: rgba(14, 18, 28, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 24px 28px;
    margin-bottom: 22px;
    box-sizing: border-box;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.client-portal-session-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0 0 6px;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    letter-spacing: -0.02em;
}

.client-portal-session-desc {
    font-size: 0.9rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0;
    max-width: 700px;
}

.client-portal-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.client-portal-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px 10px;
    font-weight: 500;
}

.client-portal-chip-vault {
    background: rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.35);
    color: #d4af37;
    font-weight: 600;
}

.client-portal-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.client-portal-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(14, 165, 233, 0.3));
    border: 1px solid rgba(6, 182, 212, 0.5);
    color: #38bdf8;
    font-weight: 600;
    font-size: 0.86rem;
    padding: 10px 18px;
    border-radius: 9999px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    box-sizing: border-box;
}

.client-portal-download-btn:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(14, 165, 233, 0.45));
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.3);
}

.client-portal-shortlist-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: #d4af37;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 9999px;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.15s;
    box-sizing: border-box;
}

.client-portal-shortlist-btn:hover {
    background: rgba(212, 175, 55, 0.2);
}

.client-portal-lock-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    font-size: 0.84rem;
    padding: 8px 16px;
    border-radius: 9999px;
    cursor: pointer;
    min-height: 44px;
    transition: all 0.15s;
    box-sizing: border-box;
}

.client-portal-lock-btn:hover {
    color: #f1f5f9;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
}

.client-portal-guide {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(6, 182, 212, 0.07);
    border: 1px solid rgba(6, 182, 212, 0.22);
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 24px;
    font-size: 0.86rem;
    color: #cbd5e1;
    line-height: 1.5;
    box-sizing: border-box;
}

.client-portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.client-photo-card {
    background: rgba(14, 18, 28, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    max-width: 100%;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.client-photo-card:hover {
    transform: translateY(-3px);
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

.client-photo-card.is-proof-selected {
    border-color: var(--accent-gold, #d4af37);
    box-shadow: 0 0 24px rgba(212, 175, 55, 0.22);
}

.client-card-media {
    position: relative;
    aspect-ratio: 3/2;
    background: #080a10;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.client-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.client-photo-card:hover .client-card-img {
    transform: scale(1.03);
}

.client-card-star-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
    border-radius: 50%;
    background: rgba(8, 10, 14, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    display: inline-flex !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
    z-index: 5;
    padding: 0;
    box-sizing: border-box;
    flex-shrink: 0;
    touch-action: manipulation;
}

.client-card-star-btn:hover {
    background: rgba(8, 10, 14, 0.95);
    border-color: var(--accent-gold, #d4af37);
    color: var(--accent-gold, #d4af37);
    transform: scale(1.08);
}

.client-card-star-btn.is-selected {
    background: var(--accent-gold, #d4af37);
    color: #08090c;
    border-color: var(--accent-gold, #d4af37);
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.45);
}

.client-card-star-btn svg,
.client-card-star-btn.is-selected svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    display: block !important;
    flex-shrink: 0 !important;
}

.client-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    box-sizing: border-box;
}

.client-card-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #f1f5f9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

.client-card-meta {
    font-size: 0.76rem;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.client-card-note-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    cursor: default;
    touch-action: auto;
}

.client-card-note-input {
    flex: 1;
    height: 36px;
    background: rgba(8, 10, 16, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0 10px;
    font-size: 16px;
    /* Touch ergonomic */
    color: #e2e8f0;
    font-family: inherit;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.client-card-note-input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(8, 10, 16, 0.85);
}

@media (min-width: 769px) {
    .client-card-note-input {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .client-portal-wrap {
        padding: 10px 12px 90px;
    }

    .client-portal-session-header {
        padding: 20px;
        flex-direction: column;
    }

    .client-portal-header-actions {
        width: 100%;
    }

    .client-portal-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 14px;
    }

    .client-portal-gate-card {
        padding: 28px 18px;
    }
}

@media (max-width: 480px) {
    .client-portal-grid {
        grid-template-columns: 1fr;
    }

    .client-portal-header-actions {
        flex-direction: column;
    }

    .client-portal-download-btn,
    .client-portal-shortlist-btn,
    .client-portal-lock-btn {
        width: 100%;
        justify-content: center;
    }
}