/* ============================================================
   LINK-MART
   Main stylesheet
   Visual theme:
   Terracotta + Charcoal + Warm Cream
   ============================================================ */


/* ============================================================
   GLOBAL RESET
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;
    color: #292522;
    background: #ffffff;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

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

button {
    cursor: pointer;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}


/* ============================================================
   HEADER
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    background: rgba(255, 252, 247, 0.96);

    border-bottom: 1px solid #eee8df;

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-inner {
    min-height: 76px;

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

    gap: 30px;
}

.logo {
    flex: 0 0 auto;

    font-size: 25px;
    font-weight: 800;

    letter-spacing: -1px;

    color: #292522;
}

.logo span {
    color: #c65d3a;
}

.main-nav {
    display: flex;
    align-items: center;

    gap: 30px;

    margin-left: auto;
}

.main-nav a {
    font-size: 14px;
    font-weight: 600;

    color: #625d58;

    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: #c65d3a;
}

.header-actions {
    display: flex;
    align-items: center;

    gap: 14px;
}

.login-link {
    font-size: 14px;
    font-weight: 600;

    color: #625d58;

    transition: color 0.2s ease;
}

.login-link:hover {
    color: #c65d3a;
}


/* ============================================================
   BUTTONS
   ============================================================ */

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

    min-height: 44px;

    padding: 0 20px;

    border: 1px solid transparent;
    border-radius: 9px;

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

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

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

.btn-primary {
    color: #ffffff;
    background: #c65d3a;

    box-shadow:
        0 6px 18px rgba(198, 93, 58, 0.20);
}

.btn-primary:hover {
    background: #ad4f30;

    box-shadow:
        0 8px 22px rgba(198, 93, 58, 0.25);
}

.btn-outline {
    color: #403b37;
    background: #ffffff;

    border-color: #ddd5cc;
}

.btn-outline:hover {
    color: #ad4f30;

    border-color: #c65d3a;
}


/* ============================================================
   HERO
   ============================================================ */

.hero {
    padding: 100px 0 90px;

    background:
        radial-gradient(
        circle at 82% 18%,
        rgba(198, 93, 58, 0.10),
        transparent 30%
        ),
        radial-gradient(
        circle at 15% 75%,
        rgba(222, 190, 155, 0.14),
        transparent 28%
        ),
        linear-gradient(
        180deg,
        #fffaf4 0%,
        #ffffff 100%
        );
}

.hero-grid {
    display: grid;

    grid-template-columns: 1.05fr 0.95fr;

    gap: 70px;

    align-items: center;
}

.hero-content {
    max-width: 650px;
}

.hero-label {
    display: inline-flex;
    align-items: center;

    padding: 7px 13px;

    border-radius: 30px;

    background: #f8e8df;
    color: #a84e32;

    font-size: 12px;
    font-weight: 800;

    letter-spacing: 0.3px;

    text-transform: uppercase;
}

.hero h1 {
    margin: 20px 0 22px;

    font-size: clamp(42px, 5vw, 68px);

    line-height: 1.04;

    letter-spacing: -3px;

    color: #24201d;
}

.hero h1 span {
    color: #c65d3a;
}

.hero p {
    max-width: 580px;

    margin: 0 0 32px;

    font-size: 18px;

    color: #706963;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;

    gap: 12px;
}


/* ============================================================
   HERO MARKETPLACE CARD
   ============================================================ */

.hero-card {
    padding: 18px;

    border: 1px solid #e8e0d7;
    border-radius: 18px;

    background: #ffffff;

    box-shadow:
        0 25px 70px rgba(54, 42, 34, 0.11);
}

.hero-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 6px 4px 16px;
}

.hero-card-title {
    font-size: 15px;
    font-weight: 800;

    color: #292522;
}

.hero-card-link {
    font-size: 12px;
    font-weight: 700;

    color: #c65d3a;
}

.hero-card-link:hover {
    color: #a84e32;
}

.publisher-preview {
    display: grid;

    grid-template-columns: 1fr auto;

    gap: 14px;

    padding: 18px 4px;

    border-top: 1px solid #eee8df;
}

.publisher-name {
    font-size: 14px;
    font-weight: 750;

    color: #292522;
}

.publisher-meta {
    margin-top: 4px;

    font-size: 12px;

    color: #857d76;
}

.publisher-price {
    text-align: right;

    font-weight: 800;

    color: #292522;
}

.publisher-price small {
    display: block;

    font-size: 11px;
    font-weight: 500;

    color: #968d85;
}


/* ============================================================
   SECTIONS
   ============================================================ */

.section {
    padding: 90px 0;
}

.section-light {
    background: #faf7f2;
}

.section-heading {
    max-width: 650px;

    margin-bottom: 42px;
}

.section-heading.center {
    margin-right: auto;
    margin-left: auto;

    text-align: center;
}

.section-heading h1,
.section-heading h2 {
    margin: 0 0 12px;

    line-height: 1.15;

    letter-spacing: -1.5px;

    color: #24201d;
}

.section-heading h1 {
    font-size: 38px;
}

.section-heading h2 {
    font-size: 38px;
}

.section-heading p {
    margin: 0;

    color: #706963;
}


/* ============================================================
   FEATURE CARDS
   ============================================================ */

.feature-grid {
    display: grid;

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

    gap: 22px;
}

.feature-card {
    padding: 30px;

    border: 1px solid #e8e0d7;
    border-radius: 14px;

    background: #ffffff;

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

.feature-card:hover {
    transform: translateY(-3px);

    border-color: #dcc9bd;

    box-shadow:
        0 12px 30px rgba(54, 42, 34, 0.07);
}

.feature-number {
    margin-bottom: 20px;

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

    color: #c65d3a;
}

.feature-card h3 {
    margin: 0 0 10px;

    font-size: 19px;

    color: #292522;
}

.feature-card p {
    margin: 0;

    font-size: 14px;

    color: #746d67;
}


/* ============================================================
   CTA
   ============================================================ */

.cta {
    padding: 90px 0;
}

.cta-box {
    padding: 60px;

    border-radius: 20px;

    background:
        linear-gradient(
        135deg,
        #292522 0%,
        #3b302a 100%
        );

    color: #ffffff;

    text-align: center;

    box-shadow:
        0 20px 50px rgba(41, 37, 34, 0.12);
}

.cta-box h2 {
    margin: 0 0 12px;

    font-size: 40px;

    letter-spacing: -1.5px;
}

.cta-box p {
    max-width: 600px;

    margin: 0 auto 28px;

    color: #d3cbc4;
}


/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    padding: 65px 0 25px;

    background: #211e1b;

    color: #ffffff;
}

.footer-top {
    display: grid;

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

    gap: 50px;

    padding-bottom: 50px;
}

.footer-brand p {
    max-width: 330px;

    margin-top: 16px;

    font-size: 14px;

    color: #aaa29b;
}

.footer-column {
    display: flex;
    flex-direction: column;

    gap: 10px;
}

.footer-column h4 {
    margin: 0 0 8px;

    font-size: 13px;

    letter-spacing: 0.5px;

    text-transform: uppercase;

    color: #ffffff;
}

.footer-column a {
    font-size: 14px;

    color: #aaa29b;

    transition: color 0.2s ease;
}

.footer-column a:hover {
    color: #e6a083;
}

.footer-bottom {
    display: flex;

    justify-content: space-between;

    gap: 20px;

    padding-top: 22px;

    border-top: 1px solid #3a342f;

    font-size: 12px;

    color: #89817a;
}

.footer-bottom div {
    display: flex;

    gap: 20px;
}


/* ============================================================
   FORM / INPUT BASE STYLING
   ============================================================ */

input,
select,
textarea {
    width: 100%;

    padding: 11px 13px;

    border: 1px solid #ddd5cc;
    border-radius: 9px;

    outline: none;

    background: #ffffff;
    color: #292522;

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

input:focus,
select:focus,
textarea:focus {
    border-color: #c65d3a;

    box-shadow:
        0 0 0 3px rgba(198, 93, 58, 0.10);
}

input::placeholder,
textarea::placeholder {
    color: #9a928b;
}


/* ============================================================
   BADGES
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;

    padding: 5px 10px;

    border-radius: 20px;

    background: #f8e8df;
    color: #a84e32;

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


/* ============================================================
   AUTHENTICATION
   ------------------------------------------------------------
   IMPORTANT:
   login.php currently uses:

       <section class="section">
           <div class="container">
               <div class="auth-card">

   Therefore these rules intentionally target .section:
   has(.auth-card), rather than relying on .auth-page.
   ============================================================ */


/* ============================================================
   AUTH PAGE OUTER AREA
   ============================================================ */

.section:has(.auth-card) {
    min-height: calc(100vh - 76px);

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

    padding: 70px 20px 90px;

    background:
        radial-gradient(
        circle at 50% 0%,
        rgba(198, 93, 58, 0.09),
        transparent 34%
        ),
        linear-gradient(
        180deg,
        #faf8f5 0%,
        #f5f2ed 100%
        );
}


/*
   The generic .container is deliberately overridden here.

   This is the critical fix that prevents the authentication
   page from appearing as a huge full-width layout.
*/

.section:has(.auth-card) > .container {
    width: 100%;
    max-width: 500px;

    margin: 0 auto;
}


/* ============================================================
   AUTH CARD
   ============================================================ */

.auth-card {
    width: 100%;

    padding: 44px 44px 38px;

    border: 1px solid #e3ddd5;
    border-radius: 18px;

    background: #ffffff;

    box-shadow:
        0 28px 70px rgba(48, 39, 32, 0.10),
        0 5px 16px rgba(48, 39, 32, 0.04);
}


/* ============================================================
   AUTH HEADING
   ------------------------------------------------------------
   login.php currently uses .section-heading.center.
   We override it here so the heading has proper spacing.
   ============================================================ */

.auth-card .section-heading.center {
    width: 100%;
    max-width: none;

    margin: 0 0 30px;

    text-align: center;
}

.auth-card .section-heading h1 {
    margin: 0 0 9px;

    font-size: 32px;
    line-height: 1.15;

    letter-spacing: -1.2px;

    color: #211e1a;
}

.auth-card .section-heading p {
    max-width: 350px;

    margin: 0 auto;

    font-size: 14px;
    line-height: 1.6;

    color: #77716a;
}


/* ============================================================
   LOGIN ERROR
   ------------------------------------------------------------
   login.php uses:

       <div class="form-error">
           Invalid email or password.
       </div>

   This creates a proper alert box instead of displaying the
   message like ordinary paragraph text.
   ============================================================ */

.auth-card .form-error {
    width: 100%;

    display: flex;
    align-items: flex-start;

    position: relative;

    margin: 0 0 24px;

    padding: 14px 16px 14px 48px;

    border: 1px solid #e4bdb3;
    border-radius: 11px;

    background: #fff5f2;

    color: #74372c;

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

    line-height: 1.5;

    box-shadow:
        0 3px 10px rgba(115, 55, 44, 0.04);
}


/*
   Error icon created entirely with CSS.
   No extra HTML is required in login.php.
*/

.auth-card .form-error::before {
    content: "!";

    position: absolute;

    top: 13px;
    left: 15px;

    width: 22px;
    height: 22px;

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

    border-radius: 50%;

    background: #a84d3c;
    color: #ffffff;

    font-size: 12px;
    font-weight: 800;

    line-height: 1;
}


/* ============================================================
   AUTH FORM
   ============================================================ */

.auth-card .auth-form {
    width: 100%;

    display: flex;
    flex-direction: column;

    gap: 20px;
}


/* ============================================================
   AUTH FORM GROUP
   ============================================================ */

.auth-card .auth-form .form-group {
    width: 100%;

    display: flex;
    flex-direction: column;

    gap: 8px;

    margin: 0;
}

.auth-card .auth-form .form-group label {
    display: block;

    margin: 0;

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

    line-height: 1.4;

    color: #302c27;
}


/* ============================================================
   AUTH INPUTS
   ============================================================ */

.auth-card .auth-form input {
    display: block;

    width: 100%;
    height: 50px;

    margin: 0;

    padding: 0 14px;

    border: 1px solid #d7d1c9;
    border-radius: 9px;

    outline: none;

    background: #ffffff;
    color: #25221e;

    font-family: inherit;
    font-size: 14px;

    line-height: 1;

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

.auth-card .auth-form input::placeholder {
    color: #aaa39a;
}

.auth-card .auth-form input:hover {
    border-color: #bdb5aa;
}

.auth-card .auth-form input:focus {
    border-color: #c65d3a;

    background: #fffdfa;

    box-shadow:
        0 0 0 3px rgba(198, 93, 58, 0.11);
}


/* ============================================================
   AUTH SUBMIT BUTTON
   ============================================================ */

.auth-card .auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 50px;

    margin: 3px 0 0;
    padding: 0 20px;

    border: 0;
    border-radius: 9px;

    background: #c65d3a;
    color: #ffffff;

    font-family: inherit;
    font-size: 14px;
    font-weight: 800;

    cursor: pointer;

    box-shadow:
        0 8px 20px rgba(198, 93, 58, 0.18);

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

.auth-card .auth-submit:hover {
    background: #ad4f30;

    transform: translateY(-1px);

    box-shadow:
        0 10px 24px rgba(198, 93, 58, 0.23);
}

.auth-card .auth-submit:active {
    transform: translateY(0);

    box-shadow:
        0 5px 12px rgba(198, 93, 58, 0.16);
}


/* ============================================================
   AUTH FOOTER
   ============================================================ */

.auth-card .auth-footer {
    width: 100%;

    margin-top: 28px;
    padding-top: 24px;

    border-top: 1px solid #ebe7e1;

    text-align: center;
}

.auth-card .auth-footer p {
    margin: 0;

    font-size: 14px;
    line-height: 1.6;

    color: #77716a;
}

.auth-card .auth-footer a {
    color: #a84e32;

    font-weight: 700;

    transition: color 0.2s ease;
}

.auth-card .auth-footer a:hover {
    color: #8d402a;
}


/* ============================================================
   AUTH LEGACY / FUTURE COMPONENTS
   ------------------------------------------------------------
   These are kept because other authentication pages may use
   them later. They do not control the current login layout.
   ============================================================ */

.auth-page {
    min-height: calc(100vh - 76px);

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

    padding: 70px 20px 90px;

    background:
        radial-gradient(
        circle at 50% 0%,
        rgba(198, 93, 58, 0.09),
        transparent 34%
        ),
        linear-gradient(
        180deg,
        #faf8f5 0%,
        #f5f2ed 100%
        );
}

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

    margin: 0 auto;
}

.auth-header {
    width: 100%;

    margin-bottom: 30px;

    text-align: center;
}

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

    min-height: 28px;

    margin-bottom: 17px;
    padding: 0 12px;

    border-radius: 30px;

    background: #f8e8df;
    color: #a84e32;

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.45px;

    text-transform: uppercase;
}

.auth-header h1 {
    margin: 0 0 9px;

    font-size: 32px;
    line-height: 1.15;
    font-weight: 800;

    letter-spacing: -1.2px;

    color: #211e1a;
}

.auth-header p {
    max-width: 350px;

    margin: 0 auto;

    font-size: 14px;
    line-height: 1.6;

    color: #77716a;
}

.auth-alert {
    width: 100%;

    display: flex;
    align-items: flex-start;

    gap: 12px;

    margin: 0 0 24px;
    padding: 14px 15px;

    border: 1px solid #e4bdb3;
    border-radius: 11px;

    background: #fff5f2;

    color: #74372c;
}

.auth-alert-icon {
    flex: 0 0 23px;

    width: 23px;
    height: 23px;

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

    border-radius: 50%;

    background: #a84d3c;
    color: #ffffff;

    font-size: 13px;
    font-weight: 800;
}

.auth-alert-content {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 2px;
}

.auth-alert-content strong {
    font-size: 13px;
    font-weight: 800;

    color: #713025;
}

.auth-alert-content span {
    font-size: 13px;

    color: #81493f;
}

.auth-mark {
    width: 46px;
    height: 46px;

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

    margin: 0 auto 18px;

    border-radius: 11px;

    background: #292522;
    color: #ffffff;

    font-size: 13px;
    font-weight: 800;
}

.auth-divider {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 14px;

    margin: 30px 0 20px;

    color: #99928a;

    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";

    flex: 1;

    height: 1px;

    background: #e8e3dc;
}

.auth-divider span {
    white-space: nowrap;
}

.auth-register {
    width: 100%;
}

.auth-register-button {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 48px;

    padding: 0 20px;

    border: 1px solid #d5cec5;
    border-radius: 9px;

    background: #ffffff;
    color: #48423c;

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

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

.auth-register-button:hover {
    border-color: #b9ab9c;

    background: #faf8f5;
    color: #855b36;

    transform: translateY(-1px);
}

.auth-back {
    margin: 20px 0 0;

    text-align: center;
}

.auth-back a {
    font-size: 13px;
    font-weight: 600;

    color: #77716a;
}

.auth-back a:hover {
    color: #a84e32;
}


/* ============================================================
   PUBLISHERS FILTER RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {

    form[action="/publishers.php"] {
        grid-template-columns: 1fr 1fr !important;
    }

    form[action="/publishers.php"] > div:first-child {
        grid-column: 1 / -1;
    }

    form[action="/publishers.php"] > button {
        width: 100%;
    }

}


/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 900px) {

    .main-nav {
        display: none;
    }

    .hero-grid {
        grid-template-columns: 1fr;

        gap: 45px;
    }

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

    .footer-top {
        grid-template-columns: 1fr 1fr;
    }

}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 700px) {

    form[action="/publishers.php"] {
        grid-template-columns: 1fr !important;
    }

    form[action="/publishers.php"] > div:first-child {
        grid-column: auto;
    }

}


@media (max-width: 600px) {

    .container {
        width: calc(100% - 28px);
    }

    .header-inner {
        min-height: 68px;
    }

    .header-actions .login-link {
        display: none;
    }

    .hero {
        padding: 65px 0;
    }

    .hero h1 {
        font-size: 42px;

        letter-spacing: -2px;
    }

    .hero p {
        font-size: 16px;
    }

    .hero-buttons {
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .section {
        padding: 65px 0;
    }

    .section-heading h1,
    .section-heading h2 {
        font-size: 30px;
    }

    .cta-box {
        padding: 40px 22px;
    }

    .cta-box h2 {
        font-size: 30px;
    }

    .footer-top {
        grid-template-columns: 1fr;

        gap: 35px;
    }

    .footer-bottom {
        flex-direction: column;
    }

    .footer-bottom div {
        flex-wrap: wrap;
    }


    /* --------------------------------------------------------
       LOGIN PAGE MOBILE
       -------------------------------------------------------- */

    .section:has(.auth-card) {
        min-height: calc(100vh - 68px);

        align-items: flex-start;

        padding: 42px 14px 65px;
    }

    .section:has(.auth-card) > .container {
        width: 100%;
        max-width: 100%;
    }

    .auth-card {
        padding: 32px 22px 30px;

        border-radius: 15px;
    }

    .auth-card .section-heading.center {
        margin-bottom: 26px;
    }

    .auth-card .section-heading h1 {
        font-size: 28px;

        letter-spacing: -0.9px;
    }

    .auth-card .section-heading p {
        font-size: 13px;
    }

    .auth-card .form-error {
        margin-bottom: 22px;

        padding: 13px 13px 13px 45px;
    }

    .auth-card .form-error::before {
        left: 13px;
    }

    .auth-card .auth-form input {
        height: 48px;
    }

    .auth-card .auth-submit {
        min-height: 49px;
    }

    .auth-card .auth-footer {
        margin-top: 25px;
        padding-top: 22px;
    }

}
.form-help {
    display: block;
    margin-top: -2px;
    color: #857d76;
    font-size: 12px;
    line-height: 1.5;
}