/* ==========================================
   Base theme styles
   ========================================== */

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

body {
    font-family: Arial, sans-serif;
    min-height: 100vh;
}

/* ==========================================
   Fonts
   ========================================== */

@font-face {
    font-family: 'BebasNeue';
    src: url('../themes/t6hdigital/assets/fonts/BebasNeue-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Candal';
    src: url('../themes/t6hdigital/assets/fonts/Candal-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ==========================================
   Buttons
   Two families from the design (images/buttons/*.png), rebuilt in CSS:
   - .btn-glossy : glossy blue, primary actions (submit)
   - .btn-flat   : flat turquoise, secondary (upload, terms)
   Change --font-button once the design font is available.
   ========================================== */

:root {
    --font-button: 'BebasNeue', sans-serif;
}

.btn-glossy,
.btn-flat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #ffffff;
    font-family: var(--font-button);
    font-weight: normal;
    letter-spacing: 1px;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s ease, filter 0.15s ease, box-shadow 0.1s ease;
}

.btn-glossy:hover,
.btn-flat:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.btn-glossy:focus-visible,
.btn-flat:focus-visible,
.btn-flat:focus-within {
    outline: 3px solid #ffd200;
    outline-offset: 2px;
}

.btn-glossy:disabled,
.btn-glossy.oc-loading {
    filter: grayscale(0.4);
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

/* Glossy blue */
.btn-glossy {
    position: relative;
    min-width: 150px;
    padding: 13px 28px 11px;
    border: 3px solid #0b57b8;
    border-radius: 18px;
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0 7px, transparent 7px 14px),
        linear-gradient(to bottom, #2bd6f4 0%, #16a6ea 40%, #0d78dc 75%, #0a63c9 100%);
    box-shadow:
        inset 0 0 0 2px rgba(130, 235, 255, 0.55), /* inner light rim */
        inset 0 -4px 0 rgba(0, 40, 120, 0.3),      /* inner bottom depth */
        0 4px 0 rgba(0, 0, 0, 0.35);               /* drop edge */
    font-size: 24px;
    text-shadow: 0 2px 0 rgba(0, 50, 130, 0.55);
}

/* Shine dots, top-left */
.btn-glossy::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 12px;
    width: 20px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 17px 1px 0 -2px #ffffff;
    opacity: 0.9;
    pointer-events: none;
}

.btn-glossy:active {
    transform: translateY(3px);
    box-shadow:
        inset 0 0 0 2px rgba(130, 235, 255, 0.55),
        inset 0 -2px 0 rgba(0, 40, 120, 0.3),
        0 1px 0 rgba(0, 0, 0, 0.35);
}

/* Flat turquoise */
.btn-flat {
    padding: 8px 24px 6px;
    border: 2px solid #c6eff4;
    border-radius: 10px;
    background: linear-gradient(to bottom, #a8e5eb 0%, #6fcad6 50%, #54b9c9 100%);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
    font-size: 22px;
    text-shadow: 0 1px 0 rgba(30, 120, 140, 0.6);
}

.btn-flat:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.btn-flat .btn-icon {
    width: 0.8em;
    height: 0.8em;
    flex-shrink: 0;
}

/* ==========================================
   Default layout header
   ========================================== */

.site-header {
    width: 100%;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header .logo img {
    max-height: 60px;
}

.site-header .top-menu a {
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border: 2px solid #fff;
    border-radius: 20px;
    color: #fff;
}

/* ==========================================
   Auth layout (login, register, forgot-password)
   ========================================== */

.auth-wrapper {
    min-height: 100vh;
    background: url('../themes/t6hdigital/assets/images/login/background.jpg') no-repeat center center;
    background-size: cover;
    display: flex;
    flex-direction: column;
    position: relative;
}

.auth-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 35px 40px 15px 80px;
    position: relative;
    z-index: 2;
}

.auth-logo {
    display: block;
    width: 86px; /* native size of logo.png (86x52); do not upscale */
    transition: transform 0.2s ease;
}

.auth-logo:hover {
    transform: scale(1.02);
}

.auth-logo img {
    width: 100%;
    height: auto;
    display: block;
}

.auth-terms-btn {
    font-size: 24px;
    padding: 8px 30px 6px;
}

.auth-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.auth-right .user-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Candal', sans-serif;
    font-size: 14px;
    color: #ffffff;
    margin-top: 10px;
}

.auth-right .user-bar a {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.auth-right .user-bar a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 40px 40px;
}

/* ==========================================
   Login page
   ========================================== */

.login-page {
    width: 100%;
    max-width: 1100px;
}

.login-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
}

.login-promo {
    flex: 1;
    max-width: 480px;
}

.login-promo img {
    width: 100%;
    height: auto;
    display: block;
}

/* Flash messages (Winter framework.extras), styled like the cream card */
body > p.flash-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10300;
    width: calc(100% - 40px);
    max-width: 460px;
    margin: 0;
    padding: 14px 44px 14px 20px;
    background: #fcefcd;
    border: 2px solid #fffaf0;
    border-left: 8px solid #3a8a3e;
    border-radius: 18px;
    box-shadow: 0 4px 0 #b6a37b, 0 7px 10px rgba(0, 0, 0, 0.3);
    color: #395f82;
    font-family: 'Candal', sans-serif;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
    word-wrap: break-word;
}

body > p.flash-message.error   { border-left-color: #e30613; color: #b0040f; }
body > p.flash-message.warning { border-left-color: #f39200; }
body > p.flash-message.info    { border-left-color: #395f82; }

body > p.flash-message.fade {
    opacity: 0;
    transition: opacity 0.4s;
}

body > p.flash-message.fade.in {
    opacity: 1;
}

body > p.flash-message button.close {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    padding: 0;
}

body > p.flash-message button.close:hover {
    opacity: 1;
}

/* Cream card replicating images/login/fondo_login.png with pure CSS */
.login-box {
    background: #fcefcd;
    border: 2px solid #fffaf0;
    border-radius: 45px;
    padding: 30px 45px 25px;
    width: 100%;
    max-width: 400px;
    box-shadow:
        0 4px 0 #b6a37b,                  /* tan bottom edge */
        0 7px 6px rgba(0, 0, 0, 0.25);    /* soft drop shadow */
}

.login-box h2 {
    font-family: 'BebasNeue', sans-serif;
    color: #395f82;
    font-size: 36px;
    text-align: center;
    margin: 0 0 10px 0;
    font-weight: normal;
    letter-spacing: 1px;
    line-height: 1;
}

.login-intro {
    text-align: center;
    font-size: 11px;
    color: #395f82;
    margin: 0 0 15px 0;
    font-family: 'Candal', sans-serif;
    line-height: 1.4;
}

.login-box h3 {
    font-family: 'BebasNeue', sans-serif;
    color: #004b8d;
    font-size: 24px;
    text-align: center;
    margin: 0 0 25px 0;
    font-weight: normal;
    letter-spacing: 1px;
}

.login-box .points-total {
    font-family: 'BebasNeue', sans-serif;
    color: #e30613;
    font-size: 28px;
    text-align: center;
    margin: -5px 0 20px 0;
    font-weight: normal;
    letter-spacing: 1px;
}

.login-form .form-group {
    margin-bottom: 10px;
}

.login-form .form-control {
    width: 100%;
    border: 2px solid #004b8d;
    border-radius: 50px;
    padding: 12px 24px;
    font-family: 'BebasNeue', sans-serif;
    font-size: 16px;
    color: #004b8d;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form .form-control::placeholder {
    color: #004b8d;
    opacity: 0.8;
}

.login-form .form-control:focus {
    border-color: #003366;
    box-shadow: 0 0 0 3px rgba(0, 75, 141, 0.1);
}

/* Upload button (flat teal) wrapping a hidden file input */
.login-form .file-label {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.login-form .file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.login-form .file-name {
    display: block;
    margin-top: 6px;
    font-family: 'Candal', sans-serif;
    font-size: 10px;
    color: #27ae60;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.login-form .file-name:empty {
    display: none;
}

.login-form .file-name::before {
    content: '\2713  ';
}

/* Submit buttons: compact and centered, like the design */
.login-form .btn-glossy {
    display: flex;
    margin: 15px auto 0;
}

.login-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 20px;
}

.login-links a {
    color: #f39200;
    text-decoration: none;
    font-size: 11px;
    font-family: 'Candal', sans-serif;
    transition: opacity 0.2s;
}

.login-links a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.login-note {
    text-align: center;
    font-size: 9px;
    color: #888888;
    margin-top: 15px;
    margin-bottom: 0;
    font-family: 'Candal', sans-serif;
    line-height: 1.4;
}

.login-form .terms-group {
    margin-bottom: 18px;
}

.login-form .terms-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'BebasNeue', sans-serif;
    font-size: 14px;
    color: #004b8d;
    cursor: pointer;
}

.login-form .terms-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #004b8d;
    cursor: pointer;
    flex-shrink: 0;
}

/* ==========================================
   Profile page (weekly points + ticket form)
   ========================================== */

.profile-side {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.profile-side .points-title {
    display: block;
    width: 100%;
    height: auto;
}

/* Blue bar with cheese coin; value sits over the bar, left of the coin */
.points-bar {
    position: relative;
    width: 84.5%; /* 256px bar vs 303px title in the design */
    aspect-ratio: 256 / 56;
    background: url('../themes/t6hdigital/assets/images/profile/puntos_contenedor.png') no-repeat center / 100% 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 22%; /* keep text clear of the coin */
}

.points-value {
    font-family: 'BebasNeue', sans-serif;
    font-size: 30px;
    line-height: 1;
    letter-spacing: 1px;
    color: #ffffff;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}

.profile-side .login-box {
    max-width: none;
}

.profile-side .login-note {
    color: #f39200;
    font-size: 10px;
}

/* ==========================================
   Terms and conditions page
   ========================================== */

.terms-page {
    width: 100%;
    max-width: 1065px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

/* Title uses .btn-flat look (not clickable) */
.terms-title {
    font-size: 28px;
    padding: 7px 28px 5px;
    cursor: default;
}

.terms-title:hover {
    filter: none;
    transform: none;
}

.terms-box {
    width: 100%;
    background: #fcefcd;
    border-radius: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    padding: 35px 20px 35px 45px;
}

/* Long legal text scrolls inside the card */
.terms-content {
    height: 440px;
    overflow-y: auto;
    padding-right: 25px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #2f5583;
}

.terms-content h2,
.terms-content h3 {
    font-family: 'BebasNeue', sans-serif;
    font-weight: normal;
    letter-spacing: 1px;
    color: #2c4f75;
    margin: 20px 0 8px;
}

.terms-content h2:first-child,
.terms-content h3:first-child {
    margin-top: 0;
}

.terms-content p,
.terms-content ul,
.terms-content ol {
    margin-bottom: 12px;
}

.terms-content ul,
.terms-content ol {
    padding-left: 20px;
}

@media (max-width: 768px) {
    .terms-title {
        font-size: 22px;
        padding: 5px 18px 3px;
    }

    .terms-box {
        border-radius: 20px;
        padding: 25px 12px 25px 22px;
    }

    .terms-content {
        height: 60vh;
        padding-right: 12px;
        font-size: 13px;
    }
}

/* ==========================================
   Message page (registration-success, thank-you)
   Large cream card with a title and a short message
   ========================================== */

.message-page {
    width: 100%;
    max-width: 1065px;
}

.message-box {
    background: #fcefcd;
    border-radius: 25px;
    min-height: 510px;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.message-box h1 {
    font-family: 'BebasNeue', sans-serif;
    font-weight: normal;
    font-size: 64px;
    line-height: 1;
    letter-spacing: 2px;
    color: #2c4f75;
    margin: 30px 0 20px;
}

.message-box p {
    font-family: Arial, sans-serif;
    font-size: 22px;
    line-height: 1.3;
    color: #2f5583;
}

.message-box .message-note {
    margin-top: 30px;
    font-family: 'Candal', sans-serif;
    font-size: 12px;
    color: #f39200;
}

@media (max-width: 768px) {
    .message-box {
        min-height: 320px;
        padding: 40px 25px;
        border-radius: 20px;
    }

    .message-box h1 {
        font-size: 40px;
        margin-top: 0;
    }

    .message-box p {
        font-size: 16px;
    }

    .message-box p br {
        display: none;
    }

    .message-box .message-note {
        font-size: 11px;
    }
}

/* ==========================================
   Register page
   ========================================== */

.register-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.register-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.register-box {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.register-form .form-group {
    margin-bottom: 1rem;
}

.register-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

.register-form button {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-transform: uppercase;
}

/* ==========================================
   Reset password page
   ========================================== */

.reset-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.reset-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.reset-box {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.reset-form .form-group {
    margin-bottom: 1rem;
}

.reset-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

.reset-form button {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-transform: uppercase;
}

/* ==========================================
   Form utilities
   ========================================== */

.form-errors {
    color: #c0392b;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.form-errors ul {
    list-style: none;
    padding: 0;
}

.error-message {
    display: block;
    color: #c0392b;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    min-height: 1rem;
}

.error-message:empty {
    display: none;
}

input.is-invalid {
    border-color: #c0392b !important;
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 1024px) {
    .auth-header {
        padding: 30px 30px 15px 50px;
    }

    .auth-terms-btn {
        font-size: 22px;
        padding: 7px 24px 5px;
    }

    .login-content {
        gap: 40px;
    }

    .login-promo {
        max-width: 380px;
    }

    .login-box {
        padding: 35px;
        max-width: 360px;
    }

    .profile-side {
        max-width: 360px;
    }

    .login-box h2 {
        font-size: 32px;
    }

    .login-box h3 {
        font-size: 22px;
    }

}

@media (max-width: 768px) {
    .auth-wrapper {
        background-position: top center;
    }

    .auth-main {
        padding: 10px 20px 30px;
    }

    .auth-header {
        padding: 20px 15px 12px 20px;
    }

    .auth-logo {
        width: 72px;
    }

    .auth-terms-btn {
        font-size: 18px;
        padding: 6px 16px 4px;
    }

    .login-content {
        flex-direction: column;
        gap: 25px;
    }

    .login-promo {
        max-width: 260px;
    }

    .login-box {
        max-width: 100%;
        padding: 30px 25px;
        border-radius: 25px;
    }

    .profile-side {
        max-width: 400px;
    }

    .points-value {
        font-size: 26px;
    }

    .login-box h2 {
        font-size: 30px;
        margin-bottom: 25px;
    }

    .login-box h3 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .site-header {
        padding: 1rem;
    }

}

@media (max-width: 480px) {
    .auth-logo {
        width: 64px;
    }

    .auth-terms-btn {
        font-size: 16px;
        padding: 5px 12px 3px;
    }

    .login-promo {
        max-width: 180px;
    }

    .login-box {
        padding: 25px 20px;
        border-radius: 20px;
    }

    .login-box h2 {
        font-size: 26px;
        margin-bottom: 20px;
    }

    .login-box h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .login-form .form-control {
        padding: 10px 16px;
        font-size: 14px;
    }

    .btn-glossy {
        font-size: 20px;
        padding: 11px 24px 9px;
    }

    .login-links {
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    .login-links a {
        font-size: 10px;
    }

    .login-note {
        font-size: 8px;
    }
}

@media (max-width: 360px) {
    .login-promo {
        max-width: 160px;
    }

    .login-box {
        padding: 20px 15px;
    }

    .auth-header {
        padding: 15px 10px 10px 15px;
    }
}
