/* =========================================================
   ENCORI
   Shared Brand & Interface Styles
   ========================================================= */

:root {
    /* ENCORI Brand */

    --encori-navy: #17264F;
    --encori-navy-dark: #101A38;

    --encori-blue: #2C63D7;
    --encori-blue-hover: #214FBA;

    /* Warmer than current background */
    --encori-ivory: #F3F0E8;

    /* Slightly warm white instead of stark white */
    --encori-white: #FFFDF9;

    /* Stronger champagne accent */
    --encori-gold: #C29A58;

    /* Darker text for more contrast */
    --encori-ink: #202631;

    --encori-slate: #5E6B7D;
    --encori-muted: #8993A3;

    /* Slightly warmer border */
    --encori-border: #D9D5CC;

    --encori-soft-blue: #EDF3FC;

    --encori-success-bg: #DCF5E4;
    --encori-success: #176239;

    --encori-error-bg: #FBE3E1;
    --encori-error: #962C2C;

    --radius-card: 16px;
    --radius-control: 10px;
    --radius-pill: 999px;

    --shadow-card:
        0 4px 16px rgba(20, 31, 58, 0.09);

    --shadow-card-hover:
        0 9px 26px rgba(20, 31, 58, 0.13);
}


/* =========================================================
   Base
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    background: var(--encori-ivory);
    color: var(--encori-ink);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;

    line-height: 1.5;
}

a {
    color: var(--encori-blue);
}

h1,
h2,
h3 {
    color: var(--encori-navy);
}

button,
input,
select,
textarea {
    font: inherit;
}


/* =========================================================
   Brand
   ========================================================= */

.encori-wordmark {
    margin: 0;

    color: var(--encori-navy);

    font-size: 34px;
    line-height: 1;
    font-weight: 750;
    letter-spacing: 0.08em;
}

.encori-wordmark-light {
    color: var(--encori-white);
}

.encori-tagline {
    margin-top: 9px;

    color: var(--encori-slate);

    font-size: 15px;
    letter-spacing: 0.01em;
}

.encori-tagline-light {
    color: #d9e1ee;
}

.encori-accent {
    width: 38px;
    height: 3px;

    margin: 14px auto 0;

    border-radius: var(--radius-pill);

    background: var(--encori-gold);
}


/* =========================================================
   Cards
   ========================================================= */

.encori-card {
    background: var(--encori-white);
    border: 1px solid var(--encori-border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}

.encori-card-padding {
    padding: 32px;
}


/* =========================================================
   Forms
   ========================================================= */

.form-group {
    margin-top: 20px;
}

.form-label {
    display: block;

    margin-bottom: 7px;

    color: var(--encori-ink);

    font-size: 15px;
    font-weight: 650;
}

.form-control {
    width: 100%;

    padding: 14px 15px;

    border: 1px solid var(--encori-border);
    border-radius: var(--radius-control);

    background: var(--encori-white);
    color: var(--encori-ink);

    font-size: 16px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--encori-blue);

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.12);
}


/* Keep browser autofill consistent with ENCORI */

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--encori-ink);
    -webkit-box-shadow: 0 0 0 1000px var(--encori-white) inset;
    box-shadow: 0 0 0 1000px var(--encori-white) inset;
    caret-color: var(--encori-ink);
}


/* =========================================================
   Buttons
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 13px 19px;

    border: 0;
    border-radius: var(--radius-control);

    font-weight: 700;
    font-size: 15px;

    text-decoration: none;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--encori-blue);
    color: var(--encori-white);
}

.btn-primary:hover {
    background: var(--encori-blue-hover);
}

.btn-full {
    width: 100%;
}


/* =========================================================
   Messages / Status
   ========================================================= */

.message-error {
    margin-bottom: 20px;
    padding: 13px 15px;

    border-radius: var(--radius-control);

    background: var(--encori-error-bg);
    color: var(--encori-error);

    font-size: 14px;
}

.status-pill {
    display: inline-block;

    padding: 7px 13px;

    border-radius: var(--radius-pill);

    font-size: 14px;
    font-weight: 700;
}

.status-success {
    background: var(--encori-success-bg);
    color: var(--encori-success);
}


/* =========================================================
   Login Page
   ========================================================= */

.auth-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px 20px;

    background: linear-gradient(
        135deg,
        var(--encori-navy-dark),
        var(--encori-navy)
    );
}

.auth-container {
    width: 100%;
    max-width: 500px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}

.auth-card {
    padding: 38px;

    background: var(--encori-white);
}

.auth-card h1 {
    margin: 0;

    font-size: 30px;
}

.auth-intro {
    margin: 9px 0 28px;

    color: var(--encori-slate);
}

.auth-note {
    margin-top: 22px;
    text-align: center;
    color: #5f6b7a;
    font-size: 13px;
    font-weight: 500;
}

.auth-card form .btn-full {
    margin-top: 22px;
}

.auth-footer {
    margin-top: 22px;

    text-align: center;

    color: #d9e1ee;

    font-size: 13px;
}


/* =========================================================
   Main App Header
   ========================================================= */

.app-header {
    background: linear-gradient(
        135deg,
        var(--encori-navy-dark),
        var(--encori-navy)
    );
    color: var(--encori-white);
    padding: 22px 30px;
}

.app-header-inner {
    width: 100%;
    max-width: 1400px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 25px;
}

.app-brand-subtitle {
    margin-top: 6px;

    color: #cbd5e1;

    font-size: 14px;
}

.app-user {
    text-align: right;
}

.app-user-name {
    font-weight: 700;
}

.app-account-name {
    margin-top: 3px;

    color: #cbd5e1;

    font-size: 13px;
}

.app-signout {
    display: inline-block;

    margin-top: 6px;

    color: var(--encori-white);

    font-size: 13px;

    text-decoration: none;
}

.app-signout:hover {
    text-decoration: underline;
}


/* =========================================================
   Main App Layout
   ========================================================= */

.app-main {
    width: 100%;
    max-width: 1400px;

    margin: 40px auto;

    padding: 0 25px;
}

.page-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 25px;
}

.page-heading {
    margin: 0;

    font-size: 28px;
}

.page-subtitle {
    margin-top: 7px;

    color: var(--encori-slate);
}


/* =========================================================
   Dashboard
   ========================================================= */

.dashboard-grid {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 20px;
}

.dashboard-card {
    padding: 26px;

    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);

    box-shadow: var(--shadow-card-hover);
}

.dashboard-label {
    margin-bottom: 10px;

    color: var(--encori-slate);

    font-size: 13px;
    font-weight: 650;

    letter-spacing: 0.05em;
}

.dashboard-number {
    color: var(--encori-ink);

    font-size: 32px;
    font-weight: 750;
}

.content-section {
    margin-top: 35px;
    padding: 30px;
}

.content-section h2 {
    margin-top: 0;
}


/* =========================================================
   Gold detail
   ========================================================= */

.gold-rule {
    width: 42px;
    height: 3px;

    margin-top: 13px;

    border-radius: var(--radius-pill);

    background: var(--encori-gold);
}


/* =========================================================
   Inventory Forms
   ========================================================= */

.inventory-form {
    overflow: hidden;
}

.form-section {
    padding: 30px;
    border-bottom: 1px solid var(--encori-border);
}

.form-section:last-of-type {
    border-bottom: 0;
}

.form-section h2 {
    margin: 0;
    font-size: 20px;
}

.form-section-intro {
    margin: 7px 0 0;
    color: var(--encori-slate);
    font-size: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 22px;
}

.form-span-2 {
    grid-column: span 2;
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
}

.form-help {
    margin-top: 7px;
    color: var(--encori-muted);
    font-size: 13px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 24px 30px;
    background: rgba(243, 240, 232, 0.45);
}

.btn-secondary {
    background: #e8e5dd;
    color: var(--encori-ink);
}

.btn-secondary:hover {
    background: #ddd9cf;
}

.message-success {
    margin-bottom: 22px;
    padding: 14px 16px;

    border-radius: var(--radius-control);

    background: var(--encori-success-bg);
    color: var(--encori-success);

    font-size: 14px;
}

.money-field {
    position: relative;
}

.money-field > span {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);

    color: var(--encori-slate);

    z-index: 1;
}

.money-field .form-control {
    padding-left: 30px;
}



/* =========================================================
   Photo Capture
   ========================================================= */

.selected-photo {
    position: relative;

    aspect-ratio: 1 / 1;
    overflow: hidden;

    border: 1px solid var(--encori-border);
    border-radius: var(--radius-control);

    background: var(--encori-ivory);
}

.selected-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.remove-photo {
    position: absolute;
    top: 7px;
    right: 7px;

    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: rgba(16, 26, 56, 0.88);
    color: white;

    font-size: 22px;
    line-height: 1;

    cursor: pointer;
}

.photo-selection {
    margin-top: 18px;
}

.photo-selection-count {
    margin-bottom: 10px;

    color: var(--encori-navy);

    font-size: 14px;
    font-weight: 700;
}

.photo-preview-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 10px;
}

.selected-photo {
    aspect-ratio: 1 / 1;

    overflow: hidden;

    border: 1px solid var(--encori-border);
    border-radius: var(--radius-control);

    background: var(--encori-ivory);
}

.selected-photo img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


.capture-main {
    max-width: 1000px;
}

.capture-card {
    overflow: hidden;
}

.capture-section {
    display: grid;
    grid-template-columns: 48px 1fr;

    gap: 22px;

    padding: 32px;

    border-bottom: 1px solid var(--encori-border);
}

.capture-step {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--encori-navy);
    color: var(--encori-white);

    font-weight: 700;
}

.capture-content h2 {
    margin: 1px 0 6px;

    font-size: 21px;
}

.capture-content p {
    margin: 0 0 20px;

    color: var(--encori-slate);
}

.photo-upload {
    min-height: 220px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    border:
        2px dashed
        var(--encori-border);

    border-radius: var(--radius-card);

    background:
        rgba(243, 240, 232, 0.45);

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.15s ease;
}

.photo-upload:hover {
    border-color: var(--encori-blue);

    background:
        var(--encori-soft-blue);

    transform: translateY(-1px);
}

.photo-icon {
    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 12px;

    border-radius: 50%;

    background: var(--encori-blue);
    color: white;

    font-size: 30px;
    font-weight: 300;
}

.photo-upload-title {
    color: var(--encori-navy);

    font-size: 18px;
    font-weight: 700;
}

.photo-upload-note {
    margin-top: 5px;

    color: var(--encori-slate);

    font-size: 13px;
}

.photo-input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
    overflow: hidden;
}

.quantity-input {
    max-width: 140px;
}

.capture-note {
    min-height: 110px;
    resize: vertical;
}

.capture-actions {
    display: flex;
    justify-content: flex-end;

    gap: 12px;

    padding: 25px 32px;

    background:
        rgba(243, 240, 232, 0.45);
}

.analyze-button {
    min-width: 190px;
}


/* =========================================================
   Item Analysis
   ========================================================= */

.analysis-card {
    overflow: hidden;
}

.analysis-section {
    padding: 30px;
    border-bottom: 1px solid var(--encori-border);
}

.analysis-section h2 {
    margin-top: 0;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.photo-preview {
    aspect-ratio: 1 / 1;
    overflow: hidden;

    border-radius: var(--radius-control);
    border: 1px solid var(--encori-border);

    background: var(--encori-ivory);
}

.photo-preview img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.analysis-detail {
    display: flex;
    justify-content: space-between;

    gap: 20px;

    padding: 14px 0;

    border-bottom: 1px solid var(--encori-border);
}

.analysis-note {
    margin-top: 20px;
}

.analysis-note p {
    margin-bottom: 0;
    color: var(--encori-slate);
}

.analysis-ready {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 30px;

    padding: 30px;

    background: rgba(243, 240, 232, 0.45);
}

.analysis-ready h2 {
    margin: 0 0 5px;
}

.analysis-ready p {
    max-width: 620px;

    margin: 0;

    color: var(--encori-slate);
}

.analysis-ready .btn:disabled {
    opacity: 0.55;
    cursor: default;
    transform: none;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 900px) {

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


@media (max-width: 600px) {



    .photo-preview-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }    

    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .analysis-section {
        padding: 24px 20px;
    }

    .analysis-ready {
        flex-direction: column;
        align-items: stretch;

        padding: 24px 20px;
    }

    .analysis-ready .btn {
        width: 100%;
    }    

    .auth-card form .btn-full {
        margin-top: 26px;
    }

    .capture-section {
        grid-template-columns: 1fr;
        gap: 14px;

        padding: 24px 20px;
    }

    .capture-step {
        width: 34px;
        height: 34px;
    }

    .photo-upload {
        min-height: 190px;
    }

    .capture-actions {
        padding: 20px;

        flex-direction: column-reverse;
    }

    .capture-actions .btn {
        width: 100%;
    }

    .quantity-input {
        max-width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-span-2 {
        grid-column: span 1;
    }

    .form-section {
        padding: 24px 20px;
    }

    .form-actions {
        padding: 20px;
    }
    

    .auth-page {
        align-items: flex-start;
        padding-top: 38px;
    }

    .auth-card {
        padding: 28px 22px;
    }

    .encori-wordmark {
        font-size: 30px;
    }

    .app-header {
        padding: 20px;
    }

    .app-header-inner {
        align-items: flex-start;
    }

    .app-main {
        margin-top: 28px;
        padding: 0 18px;
    }

    .page-heading-row {
        align-items: flex-start;
    }

    .page-heading {
        font-size: 24px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .app-account-name {
        display: none;
    }
}