/* --------------------------------------------------------------------
1. CSS RESET
Based on Meyer Reset v2.0 | 20110126 | Public Domain
-------------------------------------------------------------------- */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
    display: block;
}

body {
    line-height: 1;
}

ol, ul {
    list-style: none;
}

blockquote, q {
    quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* Create a root stacking context */
#root, #__next {
    isolation: isolate;
}


/* --------------------------------------------------------------------
2. CSS VARIABLES
-------------------------------------------------------------------- */
:root {
    --primary-color: #006838;
    --secondary-color: #3faa47;
    --black: #323132;
    --refreshing: #f5f5f5;
    --border-color: #ccc;
}


/* --------------------------------------------------------------------
3. BASE TYPOGRAPHY & BODY
-------------------------------------------------------------------- */
* {
    box-sizing: border-box;
}

body {
    font-family: "Open Sans", sans-serif;
    line-height: 30px;
    font-weight: 400;
    font-size: 1rem;
    color: var(--black);
}


/* --------------------------------------------------------------------
4. LAYOUT CONTAINERS
-------------------------------------------------------------------- */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.header-container {
    display: flex;
    flex-direction: row;
    
    padding: 16px;
}


/* --------------------------------------------------------------------
    5. HEADER SECTION
-------------------------------------------------------------------- */
.header-wrapper {
    background-color: var(--black);
    align-items: center;
}

.header-wrapper img {
    height: auto;
}

#header-img {
    height: 61px;
}


/* --------------------------------------------------------------------
6. MAIN CONTENT AREA
-------------------------------------------------------------------- */
.main-content {
    background: var(--refreshing);
    padding: 24px 0;
}

/* --- Typography --- */
.page-title {
    font-family: "EB Garamond", serif;
    color: var(--primary-color);
    font-size: 3rem;
    line-height: 3rem;
    font-weight: bold;
    margin-bottom: 24px;
}

.section-title {
    font-family: "EB Garamond", serif;
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 600;
    margin: 30px 0 8px;
}

.section-subtitle {
    padding: 0 4px;
    margin-bottom: 24px;
}

/* --- Info Box --- */
.info-box {
    background: #f5f5f5;
    padding: 24px 0;
    margin: 24px 0;
    border-radius: 8px;
}

.info-box p {
    margin-bottom: 10px;
}


/* --------------------------------------------------------------------
7. FORM ELEMENTS
-------------------------------------------------------------------- */
/* --- Form Groups --- */
.form-section {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.form-group:last-child {
    margin-bottom: 40px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* --- Required Field Indicator --- */
.required {
    color: #c00;
}

.required:before {
    content: ' *';
}

/* --- Form Submit Area --- */
.form-submit {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #ddd;
    display: flex;
    gap: 24px;
    justify-content: center;
}

#form-group-phone, #form-group-fax {
    display: flex;
    flex-grow: 1;
    gap: 8px;
}

#form-group-phone input, #form-group-fax input {
    flex: 1;
    width: 100%;
}


/* --------------------------------------------------------------------
8. INVOICE SECTION
-------------------------------------------------------------------- */
.invoice-details-section {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    margin: 0 0 24px 0;
}

/* --- Invoice Rows --- */
.invoice-row {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    flex: 1;
}

#invoice-container {
    display: flex;
    flex-direction: column;
}

.invoice-number,
.invoice-amount {
    display: flex;
    flex-direction: column;
    flex: 1;
}


.invoice-row input {
    height: 35px;
    font-size: 0.9rem;
}

/* --- Currency Input Styling --- */
.currency-input {
    display: flex;
    flex-direction: row;
    flex: 1 0 auto;
}

.currency-icon {
    position: absolute;
    margin: 2px 0 0 8px;
}

.currency-icon:after {
    content: '$';
}

.currency-input input {
    font-size: 0.9rem;
    text-indent: 16px;
    flex: 1;
    width: 100%;
}

/* --- Remove Invoice Button --- */
.remove-invoice {
    position: absolute;
    right: 16px;
    top: 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    height: 24px;
    width: 24px;
}

.remove-invoice:after {
    display: inline-block;
    content: "\00d7";
    font-size: 20px;
}

.remove-invoice:hover {
    background: #8e0f1c;
}

/* --- Add Invoice Button --- */
.add-invoice-btn, .btn-primary {
    display: inline-block;
    color: var(--secondary-color);
    transition: 0.25s;
    background: 0 0;
    border: 2px solid;
    margin: 5px 0 0 0;
    padding: 13px 28px;
    text-transform: uppercase;
    text-decoration: none;
    font-family: oswald, sans-serif;
    font-weight: 600;
    letter-spacing: 0.09em;
    font-size: 16px;
    line-height: 16px;
    box-shadow: 4px 4px 0 0 var(--secondary-color), inset 0 0 0 0 var(--secondary-color);
}

.add-invoice-btn:hover, .btn-primary:hover {
    border-color: var(--secondary-color);
    color: #fff;
    background: var(--secondary-color);
    box-shadow: 0 0 0 0 var(--secondary-color), inset 4px 4px 0 0 var(--secondary-color);
}

.add-invoice-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

        /* --- Add Invoice Button --- */
.btn-secondary {
    display: inline-block;
    color: var(--black);
    transition: 0.25s;
    background: 0 0;
    border: 2px solid;
    margin: 5px 0 0 0;
    padding: 13px 28px;
    text-transform: uppercase;
    text-decoration: none;
    font-family: oswald, sans-serif;
    font-weight: 600;
    letter-spacing: 0.09em;
    font-size: 16px;
    line-height: 16px;
    box-shadow: 4px 4px 0 0 var(--black), inset 0 0 0 0 var(--black);
}

.btn-secondary:hover {
    border-color: var(--black);
    color: #fff;
    background: var(--black);
    box-shadow: 0 0 0 0 var(--black), inset 4px 4px 0 0 var(--black);
}

/* --- Invoice Total Section --- */
.invoice-total {
    background: #fff;
    padding: 16px;
    border-radius: 6px;
    margin-top: 24px;
    border: 2px solid var(--primary-color);
}

.invoice-total-row {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
}

.invoice-total-row.total {
    font-weight: bold;
    font-size: 1.2em;
    padding-top: 10px;
    border-top: 2px solid #ddd;
}

/* --------------------------------------------------------------------
9. FOOTER
-------------------------------------------------------------------- */
.footer-wrapper {
    background-color: var(--black);
    height: 200px;
}