/**
 * Tata Pescarului — Design System (front)
 * Futurist discret · verde brand · componente unificate
 */
:root {
    --color-brand-green: #8dc63f;
    --color-brand-green-dark: #6fa82e;
    --color-dark-grey: #1a1f26;
    --color-medium-grey: #5c6573;
    --color-light-grey: #eef1f6;

    --tp-accent: var(--color-brand-green);
    --tp-accent-dark: var(--color-brand-green-dark);
    --tp-accent-glow: rgba(141, 198, 63, 0.28);
    --tp-dark: var(--color-dark-grey);
    --tp-bg: #f4f6fa;
    --tp-surface: #ffffff;
    --tp-surface-2: #f8fafc;
    --tp-border: rgba(26, 31, 38, 0.1);
    --tp-shadow: 0 8px 32px rgba(15, 20, 30, 0.08);
    --tp-shadow-sm: 0 2px 12px rgba(15, 20, 30, 0.06);
    --tp-radius: 12px;
    --tp-radius-lg: 18px;
    --tp-font: 'Outfit', 'Roboto', system-ui, sans-serif;
    --shadow-card: var(--tp-shadow-sm);
    --radius: var(--tp-radius);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--tp-font);
    background: var(--tp-bg);
    background-image:
        radial-gradient(ellipse 120% 80% at 100% -20%, rgba(141, 198, 63, 0.12), transparent 50%),
        radial-gradient(ellipse 80% 50% at 0% 100%, rgba(26, 31, 38, 0.04), transparent 45%);
    color: var(--tp-dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--tp-dark);
    transition: color 0.2s ease;
}
a:hover {
    color: var(--tp-accent);
}

/* —— Butoane (aliniere corectă) —— */
.btn,
button[type="submit"],
input[type="submit"].btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 2.75rem;
    padding: 0.55rem 1.25rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 10px;
    line-height: 1.2;
    vertical-align: middle;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-brand,
.btn-tp-primary,
#submit-order-btn,
button[style*="color-brand-green"],
a[style*="color-brand-green"].btn,
.btn[style*="background-color: var(--color-brand-green)"] {
    background: linear-gradient(135deg, var(--tp-accent) 0%, var(--tp-accent-dark) 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 14px var(--tp-accent-glow);
}

.btn-brand:hover,
.btn-tp-primary:hover,
#submit-order-btn:hover,
button[style*="color-brand-green"]:hover,
.btn[style*="background-color: var(--color-brand-green)"]:hover {
    background: linear-gradient(135deg, #9ad44a 0%, var(--tp-accent-dark) 100%) !important;
    color: #fff !important;
    box-shadow: 0 6px 20px var(--tp-accent-glow);
}

.btn-outline-tp {
    border: 2px solid var(--tp-border);
    background: var(--tp-surface);
    color: var(--tp-dark);
}
.btn-outline-tp:hover {
    border-color: var(--tp-accent);
    color: var(--tp-accent-dark);
}

/* —— Panouri & carduri —— */
.card-panel,
.checkout-form-wrapper,
.order-summary-wrapper,
.dashboard-content,
.auth-box {
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius-lg);
    box-shadow: var(--tp-shadow);
    padding: 1.75rem;
}

.checkout-form-wrapper,
.order-summary-wrapper {
    padding: 1.75rem 2rem;
}

.page-title,
.checkout-form-wrapper h3,
.order-summary-wrapper h3 {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--tp-light-grey);
}

/* —— Formulare —— */
.form-control,
.form-select {
    min-height: 2.75rem;
    border-radius: 10px;
    border: 1px solid var(--tp-border);
    background: var(--tp-surface-2);
    padding: 0.5rem 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--tp-accent);
    box-shadow: 0 0 0 3px var(--tp-accent-glow);
    background: var(--tp-surface);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-medium-grey);
    margin-bottom: 0.35rem;
}

/* —— Choice cards (radio / livrare / curier / plată) —— */
.tp-section {
    margin-bottom: 1.75rem;
}

.tp-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--tp-dark);
}

.tp-section-title .tp-step {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    background: var(--tp-dark);
    color: #fff;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tp-choice-grid {
    display: grid;
    gap: 0.75rem;
}

.tp-choice-grid.cols-2 {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.tp-choice-card {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.tp-choice-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.tp-choice-card .tp-choice-inner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    border: 2px solid var(--tp-border);
    border-radius: var(--tp-radius);
    background: var(--tp-surface-2);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    min-height: 100%;
}

.tp-choice-card .tp-choice-radio {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #c5ccd6;
    border-radius: 50%;
    margin-top: 0.15rem;
    position: relative;
    transition: border-color 0.2s, background 0.2s;
}

.tp-choice-card .tp-choice-radio::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: var(--tp-accent);
    transform: scale(0);
    transition: transform 0.2s ease;
}

.tp-choice-card input:checked + .tp-choice-inner,
.tp-choice-card.is-selected .tp-choice-inner {
    border-color: var(--tp-accent);
    background: linear-gradient(135deg, rgba(141, 198, 63, 0.08) 0%, rgba(255, 255, 255, 1) 100%);
    box-shadow: 0 0 0 3px var(--tp-accent-glow);
}

.tp-choice-card input:checked + .tp-choice-inner .tp-choice-radio,
.tp-choice-card.is-selected .tp-choice-radio {
    border-color: var(--tp-accent);
}

.tp-choice-card input:checked + .tp-choice-inner .tp-choice-radio::after,
.tp-choice-card.is-selected .tp-choice-radio::after {
    transform: scale(1);
}

.tp-choice-card .tp-choice-body {
    flex: 1;
    min-width: 0;
}

.tp-choice-card .tp-choice-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--tp-dark);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.tp-choice-card .tp-choice-desc {
    font-size: 0.8rem;
    color: var(--color-medium-grey);
    margin-top: 0.2rem;
    display: block;
}

.tp-choice-card .tp-choice-price {
    font-weight: 700;
    color: var(--tp-accent-dark);
    font-size: 0.9rem;
    white-space: nowrap;
}

.tp-choice-card .tp-choice-icon {
    font-size: 1.5rem;
    color: var(--tp-accent);
    opacity: 0.9;
}

/* Livrare inline (2 coloane) */
.tp-choice-grid.delivery-options {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 575.98px) {
    .tp-choice-grid.delivery-options {
        grid-template-columns: 1fr;
    }
}

/* —— Checkout sumar —— */
.order-summary-wrapper {
    position: sticky;
    top: 1rem;
}

.order-summary-wrapper .summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
    font-size: 0.9rem;
    gap: 1rem;
}

.order-summary-wrapper .summary-total {
    font-size: 1.25rem;
    font-weight: 800;
    border-top: 2px solid var(--tp-light-grey);
    padding-top: 1rem;
    margin-top: 0.5rem;
    color: var(--tp-dark);
}

.summary-product {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--tp-border);
}

.summary-product:last-child {
    border-bottom: none;
}

.summary-product img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid var(--tp-border);
    background: #fff;
    flex-shrink: 0;
}

.alert-checkout {
    border: none;
    border-left: 4px solid var(--tp-accent);
    border-radius: var(--tp-radius);
    background: linear-gradient(90deg, rgba(141, 198, 63, 0.12), var(--tp-surface));
}

/* —— Dashboard cont —— */
.dashboard-nav .list-group {
    border-radius: var(--tp-radius-lg);
    overflow: hidden;
    box-shadow: var(--tp-shadow-sm);
    border: 1px solid var(--tp-border);
}

.dashboard-nav .list-group-item {
    border: none;
    border-bottom: 1px solid var(--tp-border);
    padding: 0.85rem 1.1rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.dashboard-nav .list-group-item:last-child {
    border-bottom: none;
}

.dashboard-nav .list-group-item.active {
    background: linear-gradient(90deg, var(--tp-accent) 0%, var(--tp-accent-dark) 100%);
    border-color: transparent;
    color: #fff;
}

.dashboard-nav .list-group-item:hover:not(.active) {
    background: var(--tp-surface-2);
    color: var(--tp-accent-dark);
}

.dashboard-content {
    min-height: 400px;
}

/* —— Produse —— */
.product-card {
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    overflow: hidden;
    background: var(--tp-surface);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tp-shadow);
}

/* Imagine produs — pătrat fix, umple cardul (crop centrat) */
.product-card > a:first-of-type {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8fafc;
    border-bottom: 1px solid var(--tp-border);
}

.product-card .card-img-top,
.product-card > a:first-of-type img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

/* —— Auth pages —— */
.auth-wrap {
    max-width: 480px;
    margin: 2.5rem auto;
}

.auth-box h2 {
    font-weight: 800;
    letter-spacing: -0.03em;
}

/* —— Input group fix —— */
.input-group .btn {
    min-height: 2.75rem;
}

.input-group .form-control {
    min-height: 2.75rem;
}

/* —— Material icons vertical align —— */
.material-icons {
    vertical-align: middle;
    line-height: 1;
}

@media (max-width: 991.98px) {
    .dashboard-nav {
        margin-bottom: 1.25rem;
    }

    .dashboard-nav .list-group {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--tp-radius);
    }

    .dashboard-nav .list-group-item {
        flex: 0 0 auto;
        white-space: nowrap;
        border-bottom: none;
        border-right: 1px solid var(--tp-border);
    }
}

@media (max-width: 575.98px) {
    .product-card > a:first-of-type {
        aspect-ratio: 1 / 1;
    }
    .checkout-form-wrapper,
    .order-summary-wrapper {
        padding: 1.25rem;
    }

    .modal-dialog {
        margin: 0.75rem;
    }

    .form-control,
    .form-select {
        font-size: 16px;
    }
}
