@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&family=Merriweather+Sans:wght@400;600&display=swap');

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

body {
    font-family: 'Montserrat', 'Merriweather Sans', -apple-system, sans-serif;
    background: #FFFBF2;
    color: #000000;
    line-height: 1.6;
    min-height: 100vh;
    max-width: 100%;
    overflow-x: hidden;
}

.container {
    max-width: 620px;
    margin: 0 auto;
    padding: 32px 16px;
}

header {
    text-align: center;
    margin-bottom: 36px;
}

.brand {
    font-size: 13px;
    font-weight: 700;
    color: #01385E;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

h1 {
    font-size: 26px;
    font-weight: 700;
    color: #01385E;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 15px;
    color: #5E2701;
    font-weight: 400;
}

.input-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(94,39,1,0.06);
    border: 1px solid rgba(215,144,62,0.12);
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

input[type="text"],
input[type="email"] {
    flex: 1;
    font-size: 17px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    padding: 12px 14px;
    border: 2px solid #D7C9B8;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #FFFBF2;
    color: #000000;
}

input[type="email"] {
    font-family: 'Montserrat', 'Merriweather Sans', sans-serif;
    text-transform: none;
    letter-spacing: normal;
}

input[type="text"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: #D7903E;
    box-shadow: 0 0 0 3px rgba(215,144,62,0.15);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder {
    text-transform: none;
    letter-spacing: normal;
    color: #879768;
    font-family: 'Montserrat', 'Merriweather Sans', sans-serif;
}

button {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 44px;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #D7903E;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #C67830;
}

.btn-upload {
    background: #F5EDE0;
    color: #5E2701;
    border: 1px solid #D7C9B8;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
}

.btn-upload:hover:not(:disabled) {
    background: #E8DCC8;
    border-color: #D7903E;
}

.btn-upload.processing {
    background: #D7903E;
    color: white;
    border-color: #D7903E;
}

.btn-secondary {
    background: #F5EDE0;
    color: #5E2701;
    border: 1px solid #D7C9B8;
}

.btn-secondary:hover:not(:disabled) {
    background: #E8DCC8;
}

.examples {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
}

.examples:last-child {
    margin-bottom: 0;
}

.examples-label {
    font-size: 13px;
    color: #879768;
    font-weight: 500;
}

.example-pin {
    font-size: 11px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    padding: 5px 8px;
    background: #F5EDE0;
    border: 1px solid #D7C9B8;
    border-radius: 4px;
    cursor: pointer;
    color: #5E2701;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    transition: all 0.15s;
}

.example-pin:hover {
    background: #E8DCC8;
    color: #000000;
}

.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    font-size: 14px;
}

.error.show {
    display: block;
}

.error-hint {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #fecaca;
    color: #92400e;
    font-size: 13px;
}

.error-recognized {
    margin-top: 4px;
    color: #6b7280;
    font-size: 12px;
    font-style: italic;
}

/* Gate Section */
.gate-section {
    display: none;
    margin-bottom: 20px;
}

.gate-section.show {
    display: block;
}

.gate-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(94,39,1,0.06);
    border: 1px solid rgba(215,144,62,0.12);
    text-align: center;
}

.gate-card h2 {
    font-size: 20px;
    font-weight: 600;
    color: #01385E;
    margin-bottom: 8px;
}

.gate-card > p {
    color: #5E2701;
    margin-bottom: 20px;
}

.gate-form {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.gate-note {
    font-size: 12px;
    color: #879768;
}

/* Results */
.results {
    display: none;
}

.results.show {
    display: block;
}

.results-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(94,39,1,0.06);
    overflow: hidden;
    margin-bottom: 20px;
}

/* Default header — Prussian Blue */
.results-header {
    background: linear-gradient(135deg, #01385E 0%, #012A47 100%);
    color: white;
    padding: 20px;
}

/* OEM Brand Headers */
.results-card.brand-john-deere .results-header {
    background: linear-gradient(135deg, #367B3D 0%, #2D6832 100%);
}

.results-card.brand-case-ih .results-header {
    background: linear-gradient(135deg, #B91C1C 0%, #991B1B 100%);
}

.results-card.brand-caterpillar .results-header {
    background: linear-gradient(135deg, #D7903E 0%, #C67830 100%);
}

.results-card.brand-fendt .results-header {
    background: linear-gradient(135deg, #5E7E3E 0%, #4A6630 100%);
}

.results-card.brand-claas .results-header {
    background: linear-gradient(135deg, #879768 0%, #6B7A52 100%);
}

.results-card.brand-new-holland .results-header {
    background: linear-gradient(135deg, #01385E 0%, #012A47 100%);
}

.results-card.brand-hagie .results-header {
    background: linear-gradient(135deg, #367B3D 0%, #2D6832 100%);
}

.results-card.brand-massey-ferguson .results-header {
    background: linear-gradient(135deg, #5E2701 0%, #4A1F01 100%);
}

.results-card.brand-kubota .results-header {
    background: linear-gradient(135deg, #D7903E 0%, #C67830 100%);
}

.results-card.brand-vehicle .results-header {
    background: linear-gradient(135deg, #5E2701 0%, #4A1F01 100%);
}

.marketing-name {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.copy-title-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
}

.copy-title-btn:hover {
    background: rgba(255,255,255,0.3);
}

.copy-title-btn.copied {
    background: rgba(255,255,255,0.4);
}

.results-body {
    padding: 20px;
}

.specs-list {
    list-style: none;
    font-size: 15px;
}

.specs-list li {
    padding: 10px 0;
    border-bottom: 1px solid #F5EDE0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.specs-list li:last-child {
    border-bottom: none;
}

.spec-label {
    color: #879768;
    font-weight: 500;
}

.spec-value {
    font-weight: 600;
    color: #01385E;
    text-align: right;
}

.spec-value.uncertain {
    color: #D7903E;
}

.spec-note {
    font-size: 13px;
    color: #879768;
    font-weight: normal;
}

.copy-specs-section {
    padding: 16px 20px;
    background: #FFFBF2;
    border-top: 1px solid #F5EDE0;
}

.copy-specs-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.copy-specs-btn.copied {
    background: #D7903E;
    color: white;
    border-color: #D7903E;
}

.ocr-metadata {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(94,39,1,0.06);
    border: 1px solid rgba(215,144,62,0.08);
    margin-bottom: 20px;
}

.ocr-metadata h3 {
    font-size: 14px;
    font-weight: 600;
    color: #01385E;
    margin-bottom: 8px;
}

.limitations {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(94,39,1,0.06);
    border: 1px solid rgba(215,144,62,0.08);
}

.limitations h3 {
    font-size: 14px;
    font-weight: 600;
    color: #879768;
    margin-bottom: 8px;
}

.limitations p {
    font-size: 13px;
    color: #879768;
    line-height: 1.5;
}

.warning-line {
    font-size: 12px;
    color: #5E2701;
    padding: 4px 20px;
    display: none;
}

.warning-line.show {
    display: block;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0;
    font-size: 13px;
    color: #879768;
}

.footer a {
    color: #D7903E;
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
    color: #C67830;
}

/* Mobile */
@media (max-width: 500px) {
    .container {
        padding: 20px 12px;
    }

    .input-group {
        flex-direction: column;
    }

    .gate-form {
        flex-direction: column;
    }

    button {
        width: 100%;
        min-height: 48px;
    }

    .marketing-name {
        font-size: 19px;
    }

    .example-pin {
        font-size: 10px;
        min-height: 32px;
    }

    h1 {
        font-size: 22px;
    }
}

/* Tablet */
@media (max-width: 768px) and (min-width: 501px) {
    button {
        min-height: 46px;
        padding: 12px 20px;
    }

    .example-pin {
        min-height: 30px;
    }
}
