/* ==========================================================================
   Base & Reset
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background: linear-gradient(135deg, #faf7f2 0%, #f7f2eb 100%);
    color: #242438;
    font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: auto;
}

/* ==========================================================================
   Quotation Page Styles
   ========================================================================== */
.quotation-page {
    padding: 60px 0 90px;
}

.quotation-header {
    text-align: center;
    margin-bottom: 45px;
}

.quotation-header span {
    display: block;
    color: #a47a32;
    letter-spacing: 3px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.quotation-header h1 {
    margin: 0;
    color: #8f1628;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(38px, 5vw, 62px);
    line-height: 1.15;
}

.quotation-header p {
    max-width: 700px;
    margin: 16px auto 0;
    color: #777777;
    font-size: 16px;
    line-height: 1.7;
}

.quotation-card {
    background: #ffffff;
    border: 1px solid #eadfce;
    border-radius: 24px;
    padding: 35px;
    box-shadow: 0 20px 60px rgba(70, 40, 20, 0.08);
}

.section-title {
    font-family: "Playfair Display", Georgia, serif;
    color: #8f1628;
    font-size: 28px;
    margin: 0 0 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 13px;
    font-weight: 700;
    color: #555555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #ddd5ca;
    border-radius: 12px;
    padding: 13px 15px;
    font: inherit;
    outline: none;
    background: #ffffff;
    color: inherit;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #a47a32;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.divider {
    height: 1px;
    background: #eee6dc;
    margin: 35px 0;
    border: 0;
}

.product-selector {
    display: grid;
    grid-template-columns: 1fr 180px 120px 110px;
    gap: 12px;
    align-items: end;
}

.add-product-btn {
    height: 47px;
    border: 0;
    border-radius: 12px;
    background: #8f1628;
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.add-product-btn:hover {
    background: #76101f;
}

.quotation-items {
    margin-top: 25px;
}

.quotation-item {
    display: grid;
    grid-template-columns: 1fr 150px 90px 120px 45px;
    gap: 15px;
    align-items: center;
    padding: 16px;
    border: 1px solid #eee5d9;
    border-radius: 15px;
    margin-bottom: 12px;
    background: #ffffff;
}

.item-name {
    font-weight: 700;
}

.item-weight {
    color: #777777;
}

.item-price,
.item-total {
    font-weight: 700;
    color: #a71931;
}

.item-quantity input {
    width: 70px;
    padding: 9px;
    border: 1px solid #dddddd;
    border-radius: 8px;
    text-align: center;
}

.remove-item {
    border: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    color: #a71931;
    background: #fff0f2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s ease;
}

.remove-item:hover {
    background: #fde0e4;
}

.summary {
    margin-left: auto;
    max-width: 400px;
    margin-top: 30px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    color: #666666;
}

.summary-final {
    border-top: 1px solid #dddddd;
    margin-top: 8px;
    padding-top: 15px;
    font-size: 22px;
    font-weight: 700;
    color: #8f1628;
}

.submit-area {
    text-align: center;
    margin-top: 40px;
}

.submit-btn {
    border: 0;
    background: #8f1628;
    color: #ffffff;
    padding: 16px 45px;
    border-radius: 13px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.submit-btn:hover:not(:disabled) {
    background: #76101f;
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.empty-items {
    padding: 25px;
    border: 1px dashed #d9cdbd;
    border-radius: 14px;
    text-align: center;
    color: #888888;
}

.error-message {
    display: none;
    margin-bottom: 25px;
    padding: 14px 18px;
    border-radius: 12px;
    background: #fff0f0;
    border: 1px solid #efcaca;
    color: #a71931;
}

/* ==========================================================================
   Success State & Confirmation View
   ========================================================================== */
.success-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.success-wrapper {
    width: 100%;
    max-width: 1024px;
    margin: auto;
}

.success-card {
    width: 100%;
    background: #ffffff;
    border: 1px solid #eadcc9;
    border-radius: 28px;
    padding: 56px 55px;
    text-align: center;
    box-shadow: 0 25px 70px rgba(71, 44, 24, 0.10);
}

.success-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaf8ef;
    color: #148b48;
    font-size: 54px;
    font-weight: 300;
    line-height: 1;
}

.success-title {
    margin: 0;
    color: #95172b;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(38px, 5vw, 58px);
    font-weight: 700;
    line-height: 1.12;
}

.success-message {
    max-width: 760px;
    margin: 28px auto 0;
    font-size: 20px;
    line-height: 1.75;
    color: #666666;
}

.success-message + .success-message {
    margin-top: 18px;
}

.quotation-box {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 30px auto 0;
    padding: 16px 30px;
    border-radius: 12px;
    background: #faf6ef;
    border: 1px solid #eadcc9;
}

.quotation-label {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #a77932;
}

.quotation-number {
    color: #95172b;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 1px;
}

.continue-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 244px;
    height: 60px;
    margin-top: 38px;
    padding: 0 30px;
    border-radius: 12px;
    background: #95172b;
    color: #ffffff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.continue-button:hover {
    background: #7f1224;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(149, 23, 43, 0.20);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 800px) {
    .quotation-page {
        padding: 35px 0 60px;
    }

    .quotation-card {
        padding: 20px;
        border-radius: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: auto;
    }

    .product-selector {
        grid-template-columns: 1fr;
    }

    .quotation-item {
        grid-template-columns: 1fr 1fr;
    }

    .quotation-item > *:last-child {
        justify-self: end;
    }

    .summary {
        max-width: none;
    }
}

@media (max-width: 768px) {
    .success-card {
        padding: 42px 24px;
        border-radius: 22px;
    }

    .success-icon {
        width: 76px;
        height: 76px;
        margin-bottom: 25px;
        font-size: 46px;
    }

    .success-message {
        margin-top: 22px;
        font-size: 17px;
        line-height: 1.65;
    }

    .quotation-box {
        width: 100%;
        padding: 15px 18px;
    }

    .quotation-number {
        font-size: 18px;
    }

    .continue-button {
        width: 100%;
        min-width: 0;
        height: 56px;
        margin-top: 30px;
        font-size: 17px;
    }
}

@media (max-width: 420px) {
    .success-card {
        padding: 36px 20px;
    }

    .success-title {
        font-size: 32px;
    }

    .success-message {
        font-size: 16px;
    }

    .quotation-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .quotation-item > *:last-child {
        justify-self: start;
    }
}