@font-face {
    font-family: 'Waterfall';
    src: url('fonts/Waterfall-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

:root {
    --green:       #4D784D;
    --green-dark:  #436938;
    --green-light: rgba(77, 120, 77, 0.10);
    --cream:       #F5F0E8;
    --cream-dark:  #EDE7DA;
    --text:        #2C2C2C;
    --text-muted:  #6B6B5E;
    --border:      rgba(67, 105, 56, 0.22);
    --radius:      10px;
}

html { height: 100%; }

body {
    min-height: 100%;
    background-color: var(--cream);
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent, transparent 2px,
            rgba(67, 105, 56, 0.035) 2px, rgba(67, 105, 56, 0.035) 3px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent, transparent 2px,
            rgba(67, 105, 56, 0.035) 2px, rgba(67, 105, 56, 0.035) 3px
        );
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1.25rem 4rem;
}

/* -----------------------------------------------------------------------------
   Header
----------------------------------------------------------------------------- */
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.script-title {
    font-family: 'Waterfall', cursive;
    font-size: clamp(8.6rem, 8vw, 9.2rem);
    color: var(--green-dark);
    line-height: 1.1;
    font-weight: normal;
    letter-spacing: 0.01em;
}

.script-sub {
    font-family: 'Waterfall', cursive;
    font-size: clamp(3.2rem, 4vw, 3.7rem);
    color: var(--green);
    font-weight: normal;
    margin-top: 0.35rem;
    opacity: 0.88;
}

/* -----------------------------------------------------------------------------
   Divider
----------------------------------------------------------------------------- */
.divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 420px;
    margin: 0 auto 2rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider-gem {
    font-size: 1rem;
    color: var(--green);
    opacity: 0.6;
}

/* -----------------------------------------------------------------------------
   Card
----------------------------------------------------------------------------- */
.card {
    background: rgba(255, 252, 245, 0.97);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 28px rgba(67, 105, 56, 0.10);
    padding: 2rem 2rem 2.25rem;
    width: 100%;
    max-width: 520px;
}

/* -----------------------------------------------------------------------------
   Form elements
----------------------------------------------------------------------------- */
.field-group {
    margin-bottom: 1.4rem;
}

label {
    display: block;
    font-size: 0.82rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
}

input[type="text"] {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--cream);
    font-family: Georgia, serif;
    font-size: 1rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(77, 120, 77, 0.13);
}

/* -----------------------------------------------------------------------------
   Drop zone
----------------------------------------------------------------------------- */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: rgba(245, 240, 232, 0.5);
    padding: 2.5rem 1rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--green);
    background: rgba(77, 120, 77, 0.07);
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.drop-icon {
    font-size: 2rem;
    color: var(--green);
    opacity: 0.6;
    margin-bottom: 0.6rem;
}

.drop-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.drop-text strong {
    color: var(--green-dark);
}

.drop-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 0.35rem;
}

/* -----------------------------------------------------------------------------
   File list
----------------------------------------------------------------------------- */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.6rem;
    background: var(--green-light);
    border-radius: 5px;
    font-size: 0.85rem;
}

.file-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

.file-item-size {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
    white-space: nowrap;
}

.file-item-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 0 2px;
    line-height: 1;
    opacity: 0.55;
    transition: opacity 0.15s;
}

.file-item-remove:hover {
    opacity: 1;
}

/* -----------------------------------------------------------------------------
   Progress
----------------------------------------------------------------------------- */
.progress-area {
    display: none;
    margin-bottom: 1.5rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.progress-bar-track {
    height: 6px;
    background: var(--cream-dark);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--green);
    border-radius: 3px;
    width: 0%;
    transition: width 0.25s;
}

/* -----------------------------------------------------------------------------
   Buttons
----------------------------------------------------------------------------- */
.btn-upload {
    width: 100%;
    padding: 0.8rem;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 7px;
    font-family: Georgia, serif;
    font-size: 1rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn-upload:hover:not(:disabled) { background: var(--green-dark); }
.btn-upload:active:not(:disabled) { transform: scale(0.99); }
.btn-upload:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-more {
    margin-top: 1.4rem;
    padding: 0.6rem 1.4rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-family: Georgia, serif;
    font-size: 0.9rem;
    color: var(--green-dark);
    cursor: pointer;
    transition: background 0.15s;
}

.btn-more:hover { background: var(--green-light); }

/* -----------------------------------------------------------------------------
   Notice & error
----------------------------------------------------------------------------- */
.notice {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1.2rem;
    line-height: 1.6;
    opacity: 0.8;
}

.state-error {
    display: none;
    background: #fdf2f2;
    border: 1px solid rgba(180, 60, 60, 0.2);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #8B2E2E;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* -----------------------------------------------------------------------------
   Success state
----------------------------------------------------------------------------- */
.state-success {
    display: none;
    text-align: center;
    padding: 1.5rem 0 0.5rem;
}

.success-icon {
    font-size: 2.8rem;
    color: var(--green);
    margin-bottom: 0.75rem;
}

.success-title {
    font-family: 'Waterfall', cursive;
    font-size: 2.2rem;
    color: var(--green-dark);
    font-weight: normal;
    margin-bottom: 0.5rem;
}

.success-text {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* -----------------------------------------------------------------------------
   Footer
----------------------------------------------------------------------------- */
footer {
    margin-top: 3rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.55;
    text-align: center;
}

/* -----------------------------------------------------------------------------
   Responsive
----------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .card { padding: 1.5rem 1.25rem 1.75rem; }
}
