/* Auth Corner Button (Top Right) */
.auth-corner {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.auth-corner-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 42px;
    background: #2C2C2C;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: white;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.auth-corner-btn:hover {
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.auth-corner-btn .auth-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    stroke: white;
}

.auth-corner-btn.logged-in {
    background: #2C2C2C;
    color: white;
}

/* Active (account view open) → primary colour, matching the MENIU button's active state. */
body.account-active .auth-corner-btn,
body.account-active .auth-corner-btn.logged-in {
    background: var(--primary-color, #FF4D00);
    color: #fff;
}
body.account-active .auth-corner-btn .auth-icon { stroke: #fff; }

.auth-corner-btn.logged-in .auth-icon {
    stroke: white;
}

/* Registration consent (Terms + Privacy) checkbox */
.auth-consent {
    margin: 4px 0 14px;
}
.auth-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-secondary, #5f6368);
    cursor: pointer;
}
.auth-consent-label input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--primary-color, #FF4D00);
    cursor: pointer;
}
.auth-consent-label a {
    color: var(--secondary-color, #413F8D);
    text-decoration: underline;
}

/* Auth Dropdown — shares the elegant dropdown language with the MENIU (hamburger) menu
   (templates/default/common.css): same radius, hairline border, soft shadow, padding. */
.auth-dropdown {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 6px;
    min-width: 220px;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Email header — a subtle label (not the old full-bleed orange bar) with a hairline below. */
.auth-dropdown-user {
    padding: 9px 14px 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-secondary, #6B7280);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-primary, #2D3649);
    transition: background 0.15s ease, color 0.15s ease;
}

.auth-dropdown-item:hover {
    background: color-mix(in srgb, var(--theme-accent) 10%, transparent);
    color: var(--theme-accent);
}

.auth-dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.auth-dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.06);
    margin: 4px 6px;
}

.auth-dropdown-item--danger {
    color: var(--error-color);
}

.auth-dropdown-item--danger:hover {
    background: color-mix(in srgb, var(--error-color) 9%, transparent);
    color: var(--error-color);
}

/* Profile fields */
.profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 16px;
}

.profile-field:last-child {
    border-bottom: none;
}

.profile-label {
    font-size: 13px;
    color: #888;
    font-weight: 500;
    flex-shrink: 0;
}

.profile-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

/* Profile photo (try-on) */
.profile-photo-wrap {
    margin-bottom: 12px;
}

.profile-photo-preview {
    width: 160px;
    height: 213px;            /* 3:4 portrait — matches the studio render's shape */
    object-fit: contain;      /* show the WHOLE person, never crop the preview */
    background: #f4f4f6;       /* fills any letterbox gap, blends with the studio backdrop */
    border-radius: 10px;
    border: 1px solid #e2e2e2;
    display: block;
    cursor: zoom-in;
}

/* Full-screen image viewer (profile photo + Garderoba images). Above the account view
   (19000) and the confirm popin (20050). */
.img-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30000;
    animation: imgLightboxFade 0.2s ease;
}
@keyframes imgLightboxFade { from { opacity: 0; } to { opacity: 1; } }
.img-lightbox-content { position: relative; max-width: 92vw; max-height: 92vh; }
.img-lightbox-img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: block;
}
.img-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: #111;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.img-lightbox-close:hover { background: #f3f4f6; }

.profile-photo-loading {
    width: 160px;
    height: 213px;
    border-radius: 10px;
    border: 1px solid #e2e2e2;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-photo-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(65, 63, 141, 0.2);
    border-top-color: var(--secondary-color, #413F8D);
    border-radius: 50%;
    animation: profilePhotoSpin 0.8s linear infinite;
}
@keyframes profilePhotoSpin { to { transform: rotate(360deg); } }

.profile-photo-placeholder {
    width: 160px;
    height: 213px;
    border-radius: 10px;
    border: 1px dashed #ccc;
    background: #fafafa;
    color: #999;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
}

.profile-photo-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-photo-actions .auth-submit-btn {
    width: auto;
    flex: 0 0 auto;
    padding: 10px 18px;
}

.auth-submit-btn.secondary {
    background: #f3f3f3;
    color: #444;
    border: 1px solid #e0e0e0;
}

.auth-submit-btn.secondary:hover {
    background: #e9e9e9;
}

/* Destructive action (e.g. "Șterge cont" in the profile modal) — outline danger style so it
   reads as dangerous without dominating the primary "Încarcă poză" action opposite it. */
.auth-submit-btn.danger {
    background: transparent;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}
.auth-submit-btn.danger:hover {
    background: color-mix(in srgb, var(--error-color) 10%, white);
}

/* History list */
.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.history-item:last-child { border-bottom: none; }

.history-query {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.history-meta {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}

.history-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f0f0f0;
    color: #666;
}

/* Auth Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    /* Full-page (not a centered popup) — friendlier on mobile/other devices.
       Content stretches to fill the viewport; see .auth-modal-content. */
    align-items: stretch;
    justify-content: stretch;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.auth-modal-content {
    position: relative;
    background: white;
    /* FULL PAGE: fills the whole viewport instead of a centered popup box. The
       horizontal padding uses max(...) to keep the form a comfortable ~480px column on
       wide screens while going edge-to-edge on phones — readable on every device. */
    border-radius: 0;
    padding: 64px max(20px, calc((100% - 480px) / 2)) 48px;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    overflow-y: auto;
    box-shadow: none;
    animation: modalSlideUp 0.25s ease;
}

.auth-modal-content.wide {
    max-width: none;
    padding: 64px max(20px, calc((100% - 640px) / 2)) 48px;
}

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

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-modal-close:hover {
    background: #e0e0e0;
}

.auth-modal-close svg {
    width: 20px;
    height: 20px;
    stroke: #666;
}

/* Auth Form */
.auth-form {
    text-align: center;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px 0;
}

.auth-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0 0 30px 0;
}

.auth-input-group {
    text-align: left;
    margin-bottom: 20px;
}

.auth-input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.auth-input-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-family: inherit;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.auth-input-group input[type="password"] {
    font-size: 22px;
    letter-spacing: 4px;
}

.auth-input-group input:focus {
    border-color: var(--primary-color);
}

.auth-input-group input::placeholder {
    color: #aaa;
}

.auth-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

/* Password Requirements Checklist */
.password-requirements {
    margin-top: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.password-requirements-title {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.password-requirement {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    color: #888;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.password-requirement.valid {
    color: #16a34a;
}

.password-requirement .check-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.password-requirement .check-icon svg {
    width: 10px;
    height: 10px;
    stroke: transparent;
    stroke-width: 3;
    fill: none;
    transition: stroke 0.2s ease;
}

.password-requirement.valid .check-icon {
    border-color: #16a34a;
    background: #16a34a;
}

.password-requirement.valid .check-icon svg {
    stroke: white;
}

/* Password Match Indicator */
.password-match-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #888;
    padding: 8px 0;
    margin-top: 8px;
    transition: color 0.2s ease;
}

.password-match-indicator.valid {
    color: #16a34a;
}

.password-match-indicator.invalid {
    color: #dc2626;
}

.password-match-indicator .check-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.password-match-indicator .check-icon svg {
    width: 10px;
    height: 10px;
    stroke: transparent;
    stroke-width: 3;
    fill: none;
    transition: stroke 0.2s ease;
}

.password-match-indicator.valid .check-icon {
    border-color: #16a34a;
    background: #16a34a;
}

.password-match-indicator.valid .check-icon svg {
    stroke: white;
}

.password-match-indicator.invalid .check-icon {
    border-color: #dc2626;
    background: #dc2626;
}

.password-match-indicator.invalid .check-icon svg {
    stroke: white;
    /* X icon effect - rotate the checkmark */
    transform: rotate(45deg);
}

/* Auth Error/Success Messages */
.auth-error,
.auth-success {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: left;
}

.auth-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.auth-success {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

/* Auth Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    color: white;
    background: var(--primary-color);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-submit-btn:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    opacity: 0.92;
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-submit-btn.primary {
    background: var(--primary-color, rgb(65, 63, 141));
}

.auth-submit-btn.primary:hover {
    background: var(--primary-hover, rgb(55, 53, 121));
    box-shadow: 0 4px 15px rgba(65, 63, 141, 0.4);
}

.auth-submit-btn .btn-loading {
    display: flex;
    align-items: center;
}

.auth-submit-btn .spinner-icon {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Auth Links */
.auth-links {
    margin-top: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.auth-link {
    background: none;
    border: none;
    color: var(--link-color);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
}

.auth-divider {
    color: #ccc;
}

/* ───────── Account full-page view: left sidebar + left-aligned content ───────── */
.auth-modal.account-view {
    z-index: 19000;                 /* cover the top search header */
}
.auth-modal.account-view .auth-modal-content {
    padding: 56px 40px 56px 300px;  /* leave room for the 260px sidebar */
    max-width: none;
    height: 100%;
    text-align: left;
}
.auth-modal.account-view .auth-form { max-width: 640px; margin: 0; }
.auth-modal.account-view .auth-title { text-align: left; }
.auth-modal.account-view .auth-modal-close { z-index: 19002; }  /* above the sidebar */
/* History list: in the full-page account view let it flow with the page (no inner
   scroll box that looks like an embedded frame) so the pagination is fully visible. */
.auth-modal.account-view #historyList {
    max-height: none !important;
    overflow: visible !important;
}

.account-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    background: #fff;
    border-right: 1px solid var(--border-color);
    z-index: 19001;
    display: none;
    flex-direction: column;
    padding: 24px 0;
    overflow-y: auto;
}
.account-sidebar.open { display: flex; }
.account-sidebar-logo {
    display: block;
    padding: 4px 22px 18px;
    cursor: pointer;
}
.account-sidebar-logo img { height: 26px; width: auto; display: block; }
.account-sidebar-heading {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 4px 24px 14px;
}
.account-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 22px;
    border: none;
    border-left: 3px solid transparent;
    background: none;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.account-sidebar-item:hover { background: color-mix(in srgb, var(--secondary-color) 6%, white); }
.account-sidebar-item.active {
    background: color-mix(in srgb, var(--secondary-color) 12%, white);
    border-left-color: var(--secondary-color);
    color: var(--secondary-color);
    font-weight: 600;
}
.account-sidebar-item.danger { color: var(--error-color); }
.account-sidebar-item.danger:hover { background: color-mix(in srgb, var(--error-color) 10%, white); }
.account-sidebar-item svg { width: 20px; height: 20px; flex: 0 0 20px; }
.account-sidebar-divider { height: 1px; background: var(--border-color); margin: 10px 16px; }

/* Mobile-only controls for the account nav drawer — hidden on desktop (permanent sidebar). */
.account-logo-mobile { display: none; }
.account-sidebar-backdrop { display: none; }
.account-sidebar-close { display: none; }

/* "Preferințele tale" — learned attributes list */
.learned-group { margin-bottom: 18px; }
.learned-cat {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.learned-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 8px;
    background: var(--card-bg);
}
.learned-label { font-size: 14px; color: var(--text-primary); }
.learned-del {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    flex-shrink: 0;
}
.learned-del:hover { color: var(--error-color); background: color-mix(in srgb, var(--error-color) 10%, white); }

/* In-app confirmation dialog (popin) — replaces native confirm() */
.confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 20050;            /* above the full-page account view (19000) */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.confirm-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}
.confirm-box {
    position: relative;
    background: var(--card-bg, #fff);
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.2s ease;
    text-align: left;
}
.confirm-title { margin: 0 0 10px; font-size: 19px; font-weight: 700; color: var(--text-primary); }
.confirm-message { margin: 0 0 22px; font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.confirm-cancel, .confirm-ok {
    padding: 10px 18px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-color);
}
.confirm-cancel { background: #fff; color: var(--text-primary); }
.confirm-cancel:hover { background: color-mix(in srgb, var(--text-secondary) 8%, white); }
.confirm-ok { background: var(--secondary-color); color: #fff; border-color: transparent; }
.confirm-ok:hover { opacity: 0.92; }
.confirm-ok.danger { background: var(--error-color); }

/* Tablet / phone: sidebar becomes a horizontal scrollable tab bar at the top */
@media (max-width: 768px) {
    /* The account nav becomes a right-side DRAWER (same language as the MENIU menu): slid
       off-screen until the toggle opens it. `.open` (set while the account view is active)
       only governs display; `.drawer-open` does the slide. */
    .account-sidebar {
        top: 0;
        right: 0;
        left: auto;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        height: 100%;
        flex-direction: column;
        padding: 60px 0 24px;
        border-right: none;
        border-left: 1px solid var(--border-color);
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.18);
        overflow-y: auto;
        z-index: 19010;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    .account-sidebar.drawer-open { transform: translateX(0); }

    /* Dim backdrop behind the open drawer. */
    .account-sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 19009;
    }
    .account-sidebar-backdrop.show { display: block; }

    /* The existing top-right "Cont" button opens the drawer; lift it above the account view
       so it stays tappable (on the results page it sits at a low z-index by default). */
    body.account-active .auth-corner { z-index: 19015; }

    /* Logo top-left of the account view (above the panel content); shown only while active. */
    .account-logo-mobile.show {
        display: flex;
        align-items: center;
        position: fixed;
        top: 14px;
        left: 16px;
        z-index: 19008;
    }
    .account-logo-mobile.show img { height: 28px; width: auto; display: block; }

    /* Close (×) at the top-left of the drawer (top-right is where the "Cont" button sits). */
    .account-sidebar-close {
        display: flex;
        position: absolute;
        top: 14px;
        left: 14px;
        width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: none;
        background: #f3f4f6;
        color: #333;
        border-radius: 50%;
        font-size: 24px;
        line-height: 1;
        cursor: pointer;
    }
    .account-sidebar-close:hover { background: #e5e7eb; color: #111; }

    .account-sidebar-heading { display: block; }
    .account-sidebar-logo { display: none; }
    .account-sidebar-item.active {
        border-left-color: var(--secondary-color);
    }
    /* Account content takes the full width (no left sidebar gutter, no top tab bar). */
    .auth-modal.account-view .auth-modal-content {
        padding: 64px 18px 40px;
    }
}

/* Mobile Responsive — 640px matches the homepage layout breakpoint (homepage.css),
   so the account button collapses to icon-only at the same width the page goes mobile.
   Previously 480px, which left a 481–640px gap where the page was mobile but the
   button still showed the "Cont" label. */
@media (max-width: 640px) {
    .auth-corner {
        top: 10px;
        right: 10px;
    }

    .auth-corner-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .auth-corner-btn .auth-btn-text {
        display: none;
    }

    .auth-modal-content {
        /* Full-page on phones: edge-to-edge, no floating margins. */
        margin: 0;
        padding: 56px 18px 36px;
    }

    .auth-title {
        font-size: 22px;
    }
}

/* Garderoba (generated try-on images) */
.garderoba-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.garderoba-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;   /* fill the (stretched) grid cell so cards in a row are equal height */
}
.garderoba-imgwrap {
    aspect-ratio: 3 / 4;
    background: #f4f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}
.garderoba-img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.garderoba-spinner {
    width: 26px; height: 26px;
    border: 3px solid rgba(65, 63, 141, 0.2);
    border-top-color: var(--secondary-color, #413F8D);
    border-radius: 50%;
    animation: profilePhotoSpin 0.8s linear infinite;
}
.garderoba-meta { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.garderoba-date { font-size: 12px; color: #6B7280; }
.garderoba-link {
    font-size: 13px; font-weight: 600; color: var(--secondary-color, #413F8D);
    text-decoration: none; line-height: 1.35; overflow-wrap: anywhere;
    /* Always reserve 2 lines; clamp longer names with an ellipsis so every card's title
       block is the same height and the buttons below line up. */
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; min-height: 2.7em;
}
.garderoba-link:hover { text-decoration: underline; }
.garderoba-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; }
.garderoba-download {
    background: var(--primary-color, #FF4D00); border: 1px solid var(--primary-color, #FF4D00);
    color: #fff; border-radius: 8px;
    padding: 4px 12px; font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer;
}
.garderoba-download:hover { background: var(--primary-hover, #E64500); border-color: var(--primary-hover, #E64500); }
.garderoba-download:disabled { opacity: 0.6; cursor: default; }
.garderoba-del {
    background: transparent; border: 1px solid var(--error-color, #DB4033);
    color: var(--error-color, #DB4033); border-radius: 8px;
    padding: 4px 10px; font-size: 12px; font-family: inherit; cursor: pointer;
}
.garderoba-del:hover { background: color-mix(in srgb, var(--error-color, #DB4033) 10%, white); }
