﻿/* ============================================================
   INCI4ME - IDENTITY / ACCOUNT MODERN UI
   Login, registrazione, onboarding, recupero password e dashboard.
   ============================================================ */

.identity-container {
    --id-surface: #ffffff;
    --id-soft: #f8fafc;
    --id-border: #e5e7eb;
    --id-text: #1f2937;
    --id-muted: #6b7280;
    --id-dark: #111827;
    width: calc(100% - 28px);
    max-width: 540px;
    margin: 38px auto;
    padding: 30px;
    background: var(--id-surface);
    border: 1px solid var(--id-border);
    border-radius: 18px;
    box-shadow: 0 12px 36px rgba(17, 24, 39, .08);
    color: var(--id-text);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
}

/* Mantiene il dashboard OfficialIngredients già approvato sul suo canvas ampio. */
.identity-container.official-page {
    background: #f9fafb;
    border-color: transparent;
    box-shadow: none;
}

.identity-container.onboarding-page {
    max-width: 640px;
}

/* Dashboard account: mantiene la struttura esistente ma le dà più respiro. */
.identity-container:has(.nav-pills) {
    max-width: 1160px;
    padding: 24px;
    margin: 26px auto 40px;
}

.identity-container h1,
.identity-container h2,
.identity-container h3,
.identity-container h4,
.identity-container h5 {
    color: var(--id-dark);
    letter-spacing: -.02em;
}

.identity-container h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.identity-container h3 {
    font-size: 1.45rem;
    font-weight: 700;
}

.identity-container > p,
.identity-container .text-muted {
    color: var(--id-muted) !important;
    line-height: 1.65;
}

/* Evita la doppia card nel form Logout legacy. */
.identity-container .identity-container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

/* ---------------------------
   Cards account/dashboard
---------------------------- */
.identity-container .card {
    border: 1px solid var(--id-border);
    border-radius: 15px;
    box-shadow: 0 7px 24px rgba(17, 24, 39, .065);
    overflow: hidden;
    background: #fff;
}

.identity-container .card-header {
    padding: 14px 18px;
    background: linear-gradient(180deg, #ffffff, #fbfcfd);
    border-bottom: 1px solid var(--id-border);
    color: var(--id-dark);
    font-weight: 700;
}

.identity-container .card-body {
    padding: 20px;
}

/* ---------------------------
   Forms
---------------------------- */
.identity-container .form-label,
.identity-container .form-group label,
.identity-container label:not(.form-check-label) {
    display: inline-block;
    margin-bottom: 7px;
    color: #374151;
    font-size: .9rem;
    font-weight: 600;
}

.identity-input,
.identity-container .form-control,
.identity-container .form-select,
.identity-container select.form-control {
    width: 100%;
    min-height: 48px;
    padding: 10px 13px;
    border: 1px solid #d7dce2;
    border-radius: 10px;
    background: #fff;
    color: var(--id-text);
    font-size: .94rem;
    line-height: 1.4;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.identity-input:hover,
.identity-container .form-control:hover,
.identity-container .form-select:hover {
    border-color: #c2c8d0;
}

.identity-input:focus,
.identity-container .form-control:focus,
.identity-container .form-select:focus {
    border-color: #8f98a4;
    box-shadow: 0 0 0 4px rgba(17, 24, 39, .07);
    outline: none;
}

.identity-container .form-control:disabled,
.identity-container .form-control[readonly] {
    background: #f7f8fa;
    color: #6b7280;
}

.identity-container .form-check {
    padding: 12px 14px 12px 38px;
    border: 1px solid #edf0f3;
    border-radius: 10px;
    background: #fafbfc;
}

.identity-container .form-check-input {
    pointer-events: auto;
    border-color: #aeb5bf;
}

.identity-container .form-check-input:checked {
    background-color: var(--id-dark);
    border-color: var(--id-dark);
}

.identity-container .text-danger {
    display: inline-block;
    margin-top: 5px;
    font-size: .82rem;
}

/* ---------------------------
   Buttons / links
---------------------------- */
.identity-btn-dark {
    min-height: 46px;
    padding: 11px 16px;
    border: 1px solid var(--id-dark) !important;
    border-radius: 10px;
    background: var(--id-dark) !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(17, 24, 39, .14);
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.identity-btn-dark:hover:not(:disabled) {
    background: #030712 !important;
    border-color: #030712 !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(17, 24, 39, .18);
}

.identity-container .btn-outline-secondary,
.identity-container .btn-outline-dark {
    min-height: 42px;
    border-radius: 10px;
}

.identity-container a:not(.btn):not(.nav-link) {
    color: #374151;
    font-weight: 600;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.identity-container a:not(.btn):not(.nav-link):hover {
    color: #000;
}

/* ---------------------------
   Account tabs
---------------------------- */
.identity-container .nav-pills {
    gap: 8px;
    margin-bottom: 22px;
    padding: 6px;
    border: 1px solid var(--id-border);
    border-radius: 14px;
    background: #f7f9fb;
}

.identity-container .nav-pills .nav-link {
    min-height: 42px;
    padding: 10px 15px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #374151;
    font-size: .9rem;
    font-weight: 700;
    transition: color .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.identity-container .nav-pills .nav-link:hover {
    background: #eef1f4;
    color: #111827;
}

.identity-container .nav-pills .nav-link.active {
    background: #111827;
    color: #fff;
    box-shadow: 0 4px 12px rgba(17, 24, 39, .15);
}

/* ---------------------------
   Alerts / separators
---------------------------- */
.identity-container .alert {
    border-radius: 11px;
    border: 1px solid transparent;
    padding: 12px 14px;
}

.identity-container .alert-danger {
    color: #8f2732;
    background: #fff1f2;
    border-color: #f4cdd2;
}

.identity-container .alert-success {
    color: #17663a;
    background: #ecfdf3;
    border-color: #ccebd8;
}

.identity-container .alert-info {
    color: #1e4d74;
    background: #eef7ff;
    border-color: #d8ebfa;
}

.identity-container hr {
    border-color: #e5e7eb;
    opacity: 1;
}

/* ---------------------------
   Password toggle
---------------------------- */
.password-wrapper,
.identity-container .position-relative:has(.password-toggle) {
    position: relative;
}

.password-wrapper .identity-input,
.identity-container .position-relative:has(.password-toggle) .identity-input {
    padding-right: 46px;
}

.password-wrapper .password-toggle,
.identity-container .password-toggle {
    position: absolute;
    right: 10px;
    top: 70%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    transition: color .15s ease, background-color .15s ease;
}

.identity-container .position-relative > .password-toggle.position-absolute {
    top: 50% !important;
    right: 8px !important;
    margin-right: 0 !important;
}

.password-wrapper .password-toggle:hover,
.identity-container .password-toggle:hover {
    color: #111827;
    background: #f0f2f5;
}

/* Password feedback */
.identity-container #PasswordFeedback {
    padding: 10px 12px;
    border: 1px solid #edf0f3;
    border-radius: 9px;
    background: #fafbfc;
    line-height: 1.65;
}

/* Logout icon / confirmation pages */
.identity-container .logout-icon i,
.identity-container > i.fa-3x,
.identity-container > i.bi {
    filter: saturate(.85);
}

/* ---------------------------
   Responsive
---------------------------- */
@media (max-width: 768px) {
    .identity-container,
    .identity-container:has(.nav-pills) {
        width: calc(100% - 18px);
        max-width: none;
        margin: 14px auto 28px;
        padding: 18px;
        border-radius: 14px;
    }

    .identity-container h2 {
        font-size: 1.55rem;
    }

    .identity-container .nav-pills {
        flex-wrap: wrap;
    }

    .identity-container .nav-pills .nav-link {
        font-size: .82rem;
        padding: 9px 11px;
    }
}
