/**
 * perfil.css  (Batch 4.1)
 *
 * Styles for /perfil.html — account settings & profile.
 */

/* ============================================================================
 * Hero card — avatar + name + provider/pro badges
 * ============================================================================ */

.perfil-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: var(--sp-4, 16px);
    background: linear-gradient(150deg,
        rgba(74, 143, 239, 0.16) 0%,
        rgba(125, 211, 252, 0.05) 55%,
        rgba(255, 255, 255, 0.015) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(125, 211, 252, 0.28);
    border-radius: var(--r-lg, 18px);
    padding: var(--sp-5, 20px);
    margin-bottom: var(--sp-5, 20px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 16px 40px rgba(2, 6, 16, 0.4);
}

.perfil-hero::before {
    content: "";
    position: absolute;
    top: 0; left: 14%; right: 14%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.6), transparent);
}

.perfil-hero__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(150deg, rgba(74, 143, 239, 0.5), rgba(125, 211, 252, 0.25));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 6px 18px rgba(2, 6, 16, 0.4);
}

.perfil-hero__info {
    flex: 1;
    min-width: 0;
}

.perfil-hero__name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin: 0 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.perfil-hero__badges {
    display: flex;
    gap: var(--sp-2, 8px);
    flex-wrap: wrap;
    align-items: center;
}

.perfil-hero__provider {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.perfil-hero__pro {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.35), rgba(245, 158, 11, 0.35));
    color: rgba(253, 224, 71, 1);
    border: 1px solid rgba(251, 191, 36, 0.55);
}

/* ============================================================================
 * Section cards
 * ============================================================================ */

.perfil-section {
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.015) 100%);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: var(--r-lg, 18px);
    padding: var(--sp-5, 20px);
    margin-bottom: var(--sp-4, 16px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 12px 32px rgba(2, 6, 16, 0.28);
    transition: border-color 0.2s, box-shadow 0.2s;
}

@media (hover: hover) {
    .perfil-section:hover {
        border-color: rgba(125, 211, 252, 0.22);
    }
}

.perfil-section__header {
    margin-bottom: var(--sp-4, 16px);
}

.perfil-section__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text-primary, #fff);
}

.perfil-section__hint {
    font-size: 0.85rem;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.55));
    margin: 0;
    line-height: 1.5;
}

/* ============================================================================
 * Banner (rate limit warning)
 * ============================================================================ */

.perfil-banner {
    display: flex;
    gap: var(--sp-3, 12px);
    align-items: center;
    padding: var(--sp-3, 12px) var(--sp-4, 16px);
    border-radius: var(--r-md, 10px);
    margin-bottom: var(--sp-4, 16px);
}

.perfil-banner--warning {
    background: rgba(251, 191, 36, 0.10);
    border: 1px solid rgba(251, 191, 36, 0.30);
    color: rgba(253, 224, 71, 1);
}

.perfil-banner__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.perfil-banner__text {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* ============================================================================
 * Edit form
 * ============================================================================ */

.perfil-form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2, 8px);
}

.perfil-form__label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.55));
}

.perfil-form__input {
    width: 100%;
    padding: var(--sp-3, 12px) var(--sp-4, 14px);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--r-md, 10px);
    color: var(--text-primary, #fff);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s, background-color 0.15s;
}

.perfil-form__input:focus {
    outline: none;
    border-color: rgba(125, 211, 252, 0.55);
    background: rgba(255, 255, 255, 0.07);
}

.perfil-form__input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.perfil-form__counter {
    font-size: 0.75rem;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.45));
    text-align: right;
    margin-top: -4px;
    font-variant-numeric: tabular-nums;
}

.perfil-form__status {
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 8px;
}

.perfil-form__status[data-kind="success"] {
    background: rgba(74, 222, 128, 0.10);
    border: 1px solid rgba(74, 222, 128, 0.30);
    color: rgba(134, 239, 172, 1);
}

.perfil-form__status[data-kind="error"] {
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.30);
    color: rgba(248, 113, 113, 1);
}

.perfil-form .btn {
    align-self: flex-start;
    margin-top: var(--sp-2, 8px);
}

/* ============================================================================
 * Account info <dl>
 * ============================================================================ */

.perfil-info {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.perfil-info__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--sp-3, 12px);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.perfil-info__row:last-child {
    border-bottom: none;
}

.perfil-info__label {
    font-size: 0.85rem;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.55));
    margin: 0;
    flex-shrink: 0;
}

.perfil-info__value {
    font-size: 0.9rem;
    color: var(--text-primary, #fff);
    margin: 0;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
    min-width: 0;
}

.perfil-info__value--mono {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.75rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.65));
}

/* ============================================================================
 * Actions section (sign out + delete account)
 * ============================================================================ */

.perfil-section--actions {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2, 8px);
}

.perfil-action {
    width: 100%;
    padding: var(--sp-3, 12px) var(--sp-4, 16px);
    border-radius: var(--r-md, 10px);
    border: 1px solid;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.15s, border-color 0.15s;
}

.perfil-action--neutral {
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text-primary, #fff);
}

.perfil-action--neutral:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.30);
}

.perfil-action--danger {
    border-color: rgba(239, 68, 68, 0.40);
    color: rgba(248, 113, 113, 1);
}

.perfil-action--danger:hover {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.60);
}

.perfil-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================================
 * Mobile
 * ============================================================================ */

@media (max-width: 480px) {
    .perfil-hero {
        padding: var(--sp-4, 16px);
        gap: var(--sp-3, 12px);
    }
    .perfil-hero__avatar {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }
    .perfil-hero__name {
        font-size: 1.2rem;
    }
    .perfil-section {
        padding: var(--sp-4, 16px);
    }
    .perfil-info__row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .perfil-info__value {
        text-align: left;
    }
}

/* ============================================================================
 * Link account section (4.1.2)
 * ============================================================================ */

.perfil-link {
    background: linear-gradient(135deg,
        rgba(74, 143, 239, 0.10) 0%,
        rgba(125, 211, 252, 0.04) 100%);
    border: 1px solid rgba(74, 143, 239, 0.30);
}

.perfil-link__buttons {
    display: flex;
    gap: var(--sp-2, 8px);
    flex-wrap: wrap;
}

.perfil-link__btn {
    flex: 1 1 calc(50% - var(--sp-2, 8px));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2, 8px);
    padding: 12px 16px;
    border-radius: var(--r-md, 10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary, #fff);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
    min-width: 0;
}

.perfil-link__btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.perfil-link__btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.perfil-link__btn-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.perfil-link__btn--google .perfil-link__btn-icon {
    background: #fff;
    color: #4285F4;
}

.perfil-link__btn--apple .perfil-link__btn-icon {
    background: #fff;
    color: #000;
    font-size: 1.1rem;
}

@media (max-width: 380px) {
    .perfil-link__btn {
        flex: 1 1 100%;
    }
}

/* ============================================================================
 * Delete account modal (4.1.2)
 * ============================================================================ */

.delete-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-3, 12px);
}

.delete-modal[hidden] {
    display: none !important;
}

.delete-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.70);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: delete-fade 0.18s ease;
}

@keyframes delete-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.delete-modal__dialog {
    position: relative;
    background: var(--bg-card, #14223a);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--r-lg, 16px);
    padding: var(--sp-5, 20px);
    max-width: 520px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    animation: delete-slide 0.2s ease;
}

@keyframes delete-slide {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.delete-modal__close {
    position: absolute;
    top: var(--sp-3, 12px);
    right: var(--sp-3, 12px);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-modal__close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.delete-modal__header {
    display: flex;
    align-items: center;
    gap: var(--sp-3, 12px);
    margin-bottom: var(--sp-4, 16px);
    padding-right: var(--sp-7, 36px);
}

.delete-modal__icon {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
}

.delete-modal__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.delete-modal__body {
    margin-bottom: var(--sp-4, 16px);
}

.delete-modal__intro {
    color: var(--text-secondary, rgba(255, 255, 255, 0.75));
    margin: 0 0 var(--sp-3, 12px);
    line-height: 1.5;
}

.delete-modal__list {
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    padding-left: var(--sp-5, 20px);
    margin: 0 0 var(--sp-4, 16px);
    line-height: 1.6;
}

.delete-modal__list li {
    margin-bottom: 4px;
}

.delete-modal__warning {
    padding: var(--sp-3, 12px) var(--sp-4, 16px);
    background: rgba(251, 191, 36, 0.08);
    border-left: 3px solid rgba(251, 191, 36, 0.50);
    border-radius: 4px;
    margin-bottom: var(--sp-3, 12px);
    font-size: 0.85rem;
    color: rgba(253, 224, 71, 0.95);
    line-height: 1.5;
}

.delete-modal__confirm-label {
    display: block;
    margin: var(--sp-4, 16px) 0 var(--sp-2, 8px);
    color: var(--text-primary, #fff);
    font-size: 0.9rem;
}

.delete-modal__confirm-label strong {
    color: rgba(248, 113, 113, 1);
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    letter-spacing: 0.05em;
    margin: 0 4px;
}

.delete-modal__footer {
    display: flex;
    gap: var(--sp-2, 8px);
    margin-top: var(--sp-4, 16px);
}

.delete-modal__footer .perfil-action {
    flex: 1;
}

@media (max-width: 480px) {
    .delete-modal__dialog {
        padding: var(--sp-4, 16px);
    }
    .delete-modal__title {
        font-size: 1.1rem;
    }
    .delete-modal__icon {
        font-size: 1.5rem;
    }
    .delete-modal__footer {
        flex-direction: column;
    }
}
