/* ======================================================
   STOCKMATE AUTH + DASHBOARD
   Dark Red and Gold Theme
====================================================== */


/* ------------------------------
   Brand Colors
------------------------------ */

:root {

    /* Dark Red */
    --red-darkest: #4f0d16;
    --red-dark: #68151f;
    --red-main: #7f1d2d;
    --red-medium: #9b3544;
    --red-light: #f8edef;

    /* Gold */
    --gold-dark: #9a7115;
    --gold-main: #c89b2d;
    --gold-medium: #d9b65d;
    --gold-light: #fbf5e5;

    /* Neutral Colors */
    --text-dark: #332a2a;
    --text-medium: #6b6060;
    --border-color: #e6dddd;
    --background: #faf8f7;
    --white: #ffffff;
}


/* ======================================================
   BASIC SETUP
====================================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    font-family: Arial, sans-serif;

    background-color: var(--background);

    color: var(--text-dark);

    line-height: 1.6;
}


/* ======================================================
   REGISTER + LOGIN PAGES
====================================================== */

.auth-page {
    min-height: 100vh;

    display: flex;

    justify-content: center;

    align-items: center;

    padding: 40px 20px;

    background:
        linear-gradient(
            135deg,
            #fcf7f4 0%,
            #fffaf0 50%,
            #f9eff0 100%
        );
}

.auth-card {
    width: 100%;

    max-width: 460px;

    background-color: var(--white);

    padding: 36px;

    border: 1px solid var(--border-color);

    border-radius: 14px;

    box-shadow: 0 12px 30px rgba(79, 13, 22, 0.07);
}


/* ------------------------------
   StockMate Brand
------------------------------ */

.auth-brand {
    display: flex;

    align-items: center;

    justify-content: center;

    gap: 11px;

    margin-bottom: 22px;
}

.auth-brand img {
    width: 82px;
    height: 82px;

    object-fit: contain;
}

.auth-brand h1 {
    margin: 0;

    color: var(--red-dark);

    font-size: 29px;

    line-height: 1.1;
}


/* ------------------------------
   Auth Headings
------------------------------ */

.auth-card h2 {
    margin: 0 0 10px;

    text-align: center;

    color: var(--red-dark);

    font-size: 28px;
}

.intro-text {
    margin: 0 0 30px;

    text-align: center;

    color: var(--text-medium);

    font-size: 15px;
}


/* ======================================================
   FORMS
====================================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 7px;

    color: var(--red-dark);

    font-weight: 700;

    font-size: 14px;
}

.form-group input {
    width: 100%;

    padding: 13px 14px;

    background-color: var(--white);

    color: var(--text-dark);

    border: 1px solid #d9caca;

    border-radius: 8px;

    font-size: 16px;
}

.form-group input::placeholder {
    color: #a39494;
}

.form-group input:focus {
    outline: none;

    border-color: var(--gold-main);

    box-shadow: 0 0 0 3px rgba(200, 155, 45, 0.13);
}


/* ======================================================
   BUTTONS
====================================================== */

button {
    border: none;

    border-radius: 8px;

    font-size: 15px;

    font-weight: 700;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.6;

    cursor: not-allowed;

    transform: none;
}


/* Register and Login Buttons */

.auth-card form button {
    width: 100%;

    padding: 13px 24px;

    color: var(--white);

    background-color: var(--red-main);

    border: 1px solid var(--red-main);
}

.auth-card form button:hover {
    background-color: var(--red-dark);

    border-color: var(--red-dark);
}


/* ======================================================
   MESSAGES
====================================================== */

.message {
    display: none;

    margin-top: 18px;

    padding: 12px 14px;

    border-radius: 8px;

    text-align: center;

    font-size: 14px;
}

.success-message {
    display: block;

    color: #6d520d;

    background-color: var(--gold-light);

    border: 1px solid #ead69e;
}

.error-message {
    display: block;

    color: var(--red-dark);

    background-color: var(--red-light);

    border: 1px solid #e7c6cb;
}


/* ======================================================
   AUTH LINKS
====================================================== */

.account-link,
.home-link {
    text-align: center;
}

.account-link {
    margin-top: 25px;
}

.home-link {
    margin-top: 10px;
}

.account-link a,
.home-link a {
    color: var(--red-main);

    text-decoration: none;

    font-weight: 600;
}

.account-link a:hover,
.home-link a:hover {
    color: var(--gold-dark);

    text-decoration: underline;
}


/* ======================================================
   DASHBOARD
====================================================== */

.dashboard-page {
    display: none;

    min-height: 100vh;

    background-color: #faf8f7;
}

.dashboard-main {
    width: min(1180px, 92%);

    margin: 0 auto;

    padding: 38px 0 60px;
}


/* ======================================================
   DASHBOARD HEADER
====================================================== */

.dashboard-header {
    background-color: var(--white);

    padding: 14px 6%;

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    border-bottom: 1px solid var(--border-color);

    box-shadow: 0 2px 10px rgba(79, 13, 22, 0.04);
}

.dashboard-brand {
    display: flex;

    align-items: center;

    gap: 14px;
}

.dashboard-brand img {
    width: 86px;
    height: 86px;

    object-fit: contain;
}

.dashboard-brand h1 {
    margin: 0;

    color: var(--red-dark);

    font-size: 29px;
}

.dashboard-brand p {
    margin: 2px 0 0;

    color: var(--gold-dark);

    font-size: 13px;

    font-weight: 700;
}


/* Logout Button */

.logout-button {
    padding: 11px 20px;

    color: var(--red-dark);

    background-color: var(--gold-light);

    border: 1px solid #dfc77f;
}

.logout-button:hover {
    color: var(--white);

    background-color: var(--red-main);

    border-color: var(--red-main);
}


/* ======================================================
   DASHBOARD CARDS
====================================================== */

.dashboard-card {
    background-color: var(--white);

    border: 1px solid var(--border-color);

    border-radius: 14px;

    box-shadow: 0 7px 20px rgba(79, 13, 22, 0.05);
}


/* ======================================================
   WELCOME SECTION
====================================================== */

.welcome-card {
    margin-bottom: 28px;

    padding: 32px 34px;

    background:
        linear-gradient(
            135deg,
            var(--red-light),
            #fff9ef
        );

    border: 1px solid #e4cfd2;

    border-left: 5px solid var(--gold-main);

    border-radius: 14px;
}

.welcome-card h2 {
    margin: 0 0 8px;

    color: var(--red-dark);

    font-size: 30px;

    line-height: 1.25;
}

.welcome-card p {
    margin: 0;

    max-width: 760px;

    color: var(--text-medium);
}


/* ======================================================
   SECTION LABELS
====================================================== */

.section-label {
    margin: 0 0 5px;

    color: var(--gold-dark);

    font-size: 13px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.08em;
}


/* ======================================================
   ADD / EDIT PRODUCT SECTION
====================================================== */

.product-section {
    margin-bottom: 28px;

    padding: 32px;
}

.section-heading {
    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    gap: 30px;

    margin-bottom: 28px;
}

.section-heading h2 {
    margin: 0;

    color: var(--red-dark);

    font-size: 27px;
}

.product-intro {
    max-width: 440px;

    margin: 3px 0 0;

    color: var(--text-medium);
}


/* ======================================================
   PRODUCT FORM
====================================================== */

.product-form {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 20px 24px;
}

.product-form .form-group {
    margin-bottom: 0;
}

.product-form-buttons {
    grid-column: 1 / -1;

    display: flex;

    gap: 12px;

    margin-top: 4px;
}


/* Save / Update Button */

.primary-button {
    min-width: 170px;

    padding: 12px 22px;

    color: var(--white);

    background-color: var(--red-main);

    border: 1px solid var(--red-main);
}

.primary-button:hover {
    background-color: var(--red-dark);

    border-color: var(--red-dark);
}


/* Cancel Edit Button */

.cancel-button {
    display: none;

    min-width: 140px;

    padding: 12px 22px;

    color: var(--red-dark);

    background-color: var(--gold-light);

    border: 1px solid #dfc77f;
}

.cancel-button:hover {
    background-color: var(--gold-main);

    border-color: var(--gold-main);

    color: var(--red-darkest);
}


/* ======================================================
   PRODUCT LIST
====================================================== */

.products-list-section {
    padding: 32px;
}

.products-list-header {
    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    gap: 30px;

    margin-bottom: 24px;
}

.products-list-header h2 {
    margin: 0;

    color: var(--red-dark);

    font-size: 27px;
}

.products-list-header p {
    margin: 3px 0 0;

    color: var(--text-medium);
}


/* ======================================================
   NO PRODUCTS MESSAGE
====================================================== */

.no-products-message {
    margin: 0;

    padding: 24px;

    color: var(--text-medium);

    background-color: #fffaf3;

    border: 1px dashed #ddc98f;

    border-radius: 10px;

    text-align: center;
}


/* ======================================================
   PRODUCTS TABLE
====================================================== */

.products-table-container {
    display: none;

    width: 100%;

    overflow-x: auto;

    border: 1px solid var(--border-color);

    border-radius: 10px;
}

.products-table {
    width: 100%;

    min-width: 820px;

    border-collapse: collapse;

    background-color: var(--white);
}

.products-table th,
.products-table td {
    padding: 15px 16px;

    text-align: left;

    vertical-align: middle;

    border-bottom: 1px solid #eee4e4;
}

.products-table th {
    color: var(--red-dark);

    background-color: #fbf5f1;

    font-size: 14px;

    font-weight: 700;
}

.products-table td {
    color: #5c5050;

    font-size: 14px;
}

.products-table tbody tr:hover {
    background-color: #fffaf7;
}

.products-table tbody tr:last-child td {
    border-bottom: none;
}


/* ======================================================
   PRODUCT ACTION BUTTONS
====================================================== */

.action-buttons {
    display: flex;

    gap: 8px;

    align-items: center;
}

.edit-button,
.delete-button {
    padding: 8px 13px;

    font-size: 13px;
}


/* Edit */

.edit-button {
    color: var(--red-dark);

    background-color: var(--gold-light);

    border: 1px solid #dfc77f;
}

.edit-button:hover {
    background-color: var(--gold-main);

    border-color: var(--gold-main);
}


/* Delete */

.delete-button {
    color: var(--red-dark);

    background-color: var(--red-light);

    border: 1px solid #e1b9bf;
}

.delete-button:hover {
    color: var(--white);

    background-color: var(--red-main);

    border-color: var(--red-main);
}


/* ======================================================
   TABLET
====================================================== */

@media (max-width: 900px) {

    .dashboard-main {
        width: min(94%, 900px);
    }

    .section-heading,
    .products-list-header {
        flex-direction: column;

        gap: 8px;
    }

    .product-intro {
        max-width: none;
    }

}


/* ======================================================
   MOBILE
====================================================== */

@media (max-width: 650px) {

    /* Auth */

    .auth-page {
        padding: 25px 15px;
    }

    .auth-card {
        padding: 26px 20px;
    }

    .auth-brand img {
        width: 66px;
        height: 66px;
    }

    .auth-brand h1 {
        font-size: 24px;
    }

    .auth-card h2 {
        font-size: 24px;
    }


    /* Dashboard Header */

    .dashboard-header {
        padding: 10px 4%;

        gap: 12px;
    }

    .dashboard-brand {
        gap: 8px;
    }

    .dashboard-brand img {
        width: 62px;
        height: 62px;
    }

    .dashboard-brand h1 {
        font-size: 22px;
    }

    .dashboard-brand p {
        display: none;
    }

    .logout-button {
        padding: 9px 13px;

        font-size: 13px;
    }


    /* Dashboard Main */

    .dashboard-main {
        width: 92%;

        padding-top: 24px;

        padding-bottom: 40px;
    }


    /* Welcome */

    .welcome-card {
        padding: 24px 20px;

        margin-bottom: 20px;
    }

    .welcome-card h2 {
        font-size: 24px;
    }


    /* Product Sections */

    .product-section,
    .products-list-section {
        padding: 22px 18px;

        margin-bottom: 20px;
    }

    .section-heading h2,
    .products-list-header h2 {
        font-size: 23px;
    }


    /* Product Form */

    .product-form {
        grid-template-columns: 1fr;

        gap: 17px;
    }

    .product-form-buttons {
        flex-direction: column;
    }

    .primary-button,
    .cancel-button {
        width: 100%;

        min-width: 0;
    }


    /* Products Table */

    .products-table-container {
        overflow-x: auto;
    }

    .products-table {
        min-width: 720px;
    }

    .products-table th,
    .products-table td {
        padding: 12px;

        white-space: nowrap;
    }

    .action-buttons {
        gap: 6px;
    }

    .edit-button,
    .delete-button {
        padding: 7px 10px;

        font-size: 12px;
    }

}