/* ============================================
   MONTELEONE TONSOR — REUSABLE COMPONENTS
   ============================================ */

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: 14px 32px;
    font-family: var(--font-family);
    font-size: var(--label-size);
    font-weight: var(--label-weight);
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    min-height: 44px;
}

.btn-primary {
    background: var(--gradient-brushed-metal);
    color: var(--soft-white);
    border: 1px solid var(--marble-grey);
}

.btn-primary:hover {
    border-color: var(--cool-led);
    box-shadow: var(--led-glow);
    color: var(--cool-led);
}

.btn-outline {
    background: transparent;
    color: var(--soft-white);
    border: 1px solid var(--marble-grey);
}

.btn-outline:hover {
    border-color: var(--cool-led);
    box-shadow: var(--led-glow);
    color: var(--cool-led);
}

.btn-lg {
    padding: 18px 48px;
    font-size: 13px;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 11px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ─── DARK FROSTED CARDS ─── */
.card-frosted {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--led-glow);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    transition: all var(--transition);
}

.card-frosted:hover {
    border-color: #fff;
    box-shadow: var(--led-glow-lg);
}

.card-frosted.selected {
    border-color: var(--cool-led);
    box-shadow: var(--led-glow);
    background: rgba(56, 58, 55, 0.25);
}

/* ─── GHOST INPUTS ─── */
.input-ghost {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--marble-grey);
    color: var(--soft-white);
    font-family: var(--font-family);
    font-size: var(--body-md-size);
    padding: 12px 0;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.input-ghost:focus {
    border-bottom-color: var(--cool-led);
    box-shadow: 0 2px 0 0 rgba(248, 250, 255, 0.3);
}

.input-ghost::placeholder {
    color: var(--outline);
    font-weight: 300;
}

.input-group {
    position: relative;
    margin-bottom: var(--space-3);
}

.input-group label {
    display: block;
    font-size: var(--label-size);
    font-weight: var(--label-weight);
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
    color: var(--on-surface-variant);
    margin-bottom: var(--space-1);
}

.input-error {
    border-bottom-color: var(--error) !important;
}

.error-text {
    color: var(--error);
    font-size: var(--body-sm-size);
    margin-top: 4px;
}

/* ─── SELECT ─── */
.select-ghost {
    width: 100%;
    background: var(--surface-container);
    border: 1px solid var(--marble-grey);
    color: var(--soft-white);
    font-family: var(--font-family);
    font-size: var(--body-md-size);
    padding: 12px 16px;
    border-radius: var(--radius);
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238f9194' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color var(--transition);
}

.select-ghost:focus {
    border-color: var(--cool-led);
    box-shadow: var(--led-glow);
}

/* ─── INTERACTIVE CHIPS ─── */
.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius);
    font-family: var(--font-family);
    font-size: var(--body-sm-size);
    color: var(--on-surface-variant);
    cursor: pointer;
    transition: all var(--transition);
    background: transparent;
}

.chip:hover {
    border-color: var(--outline);
    color: var(--soft-white);
}

.chip.selected {
    background: var(--gradient-brushed-metal);
    color: var(--charcoal);
    border-color: var(--outline);
    font-weight: 600;
}

.chip:disabled, .chip.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ─── NAVIGATION BAR ─── */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    padding: var(--space-2) var(--margin);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(18, 20, 18, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(107, 111, 114, 0.2);
    transition: background var(--transition);
}

.nav-brand {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--soft-white);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.nav-link {
    font-size: var(--label-size);
    font-weight: 500;
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
    color: var(--on-surface-variant);
    text-decoration: none;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--cool-led);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--cool-led);
    box-shadow: var(--led-glow);
}

.nav-cta {
    padding: 10px 24px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-actions .btn {
    min-height: 44px;
    white-space: nowrap;
}

.nav-client {
    border-color: rgba(248, 250, 255, 0.72);
}

.nav-office {
    color: var(--outline);
    border-color: rgba(107, 111, 114, 0.72);
}

.nav-office:hover {
    color: var(--cool-led);
}

@media (max-width: 1180px) {
    .nav-bar {
        padding-inline: 32px;
    }

    .nav-links {
        gap: var(--space-2);
    }

    .nav-link {
        font-size: 11px;
    }

    .nav-actions .btn {
        padding-inline: 16px;
    }
}

/* Mobile menu toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--soft-white);
    transition: all var(--transition);
}

@media (max-width: 1040px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(18, 20, 18, 0.95);
        backdrop-filter: blur(20px);
        padding: var(--space-3);
        gap: var(--space-2);
        border-bottom: 1px solid var(--outline-variant);
    }
    .nav-links.open { display: flex; }
    .nav-toggle { display: flex; }
    .nav-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--space-1);
    }
    .nav-actions .btn {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .nav-bar {
        padding: 14px var(--margin);
    }

    .nav-brand {
        max-width: calc(100vw - 96px);
        font-size: 13px;
        letter-spacing: 0.09em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-links {
        padding: var(--space-2) var(--margin);
    }

    .btn,
    .btn-lg,
    .btn-sm {
        width: auto;
        padding: 13px 18px;
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }
}

/* ─── COOKIE BANNER ─── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-cookie);
    background: rgba(18, 20, 18, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--outline-variant);
    padding: var(--space-3) var(--margin);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    animation: fadeInUp 0.5s ease;
    transform-origin: bottom;
}

.cookie-banner.hidden { display: none; }

.cookie-text {
    flex: 1;
    font-size: var(--body-sm-size);
    color: var(--on-surface-variant);
    line-height: 1.5;
}

.cookie-text a {
    color: var(--cool-led);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .cookie-banner {
        flex-direction: column;
        padding: var(--space-3);
        text-align: center;
    }

    .cookie-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* ─── MODAL OVERLAY ─── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-modal);
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface-container);
    border: var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-spring);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.modal-close {
    background: none;
    border: none;
    color: var(--on-surface-variant);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.modal-close:hover { color: var(--cool-led); }

/* ─── PROGRESS BAR ─── */
.progress-bar {
    width: 100%;
    height: 2px;
    background: var(--surface-container-highest);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-led-bar);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
    box-shadow: var(--led-glow);
}

/* ─── TOAST NOTIFICATIONS ─── */
.toast-container {
    position: fixed;
    top: var(--space-10);
    right: var(--space-3);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.toast {
    background: var(--surface-container-high);
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-lg);
    padding: var(--space-2) var(--space-3);
    color: var(--on-surface);
    font-size: var(--body-sm-size);
    min-width: 280px;
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

@media (max-width: 560px) {
    .toast-container {
        left: var(--margin);
        right: var(--margin);
        top: 88px;
    }

    .toast {
        min-width: 0;
        width: 100%;
    }

    .modal {
        width: calc(100vw - 32px);
        padding: var(--space-3);
    }
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.info { border-left: 3px solid var(--cool-led); }

/* ─── LOADING SPINNER ─── */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--outline-variant);
    border-top-color: var(--cool-led);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ─── SERVICE ICON ─── */
.service-icon {
    width: 40px;
    height: 40px;
    border: 1px solid var(--outline-variant);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--on-surface-variant);
    font-size: 18px;
    margin-bottom: var(--space-2);
}

/* ─── TABS ─── */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--outline-variant);
    margin-bottom: var(--space-4);
}

.tab {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    background: none;
    border: none;
    font-family: var(--font-family);
    font-size: var(--label-size);
    font-weight: var(--label-weight);
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
    color: var(--on-surface-variant);
    cursor: pointer;
    position: relative;
    transition: color var(--transition);
}

.tab.active {
    color: var(--cool-led);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--cool-led);
    box-shadow: var(--led-glow);
}
