/* Alcon brand theme – based on alcon.com design tokens */

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

:root {
    --alcon-blue: #003595;
    --alcon-blue-hover: #0047c8;
    --alcon-blue-pressed: #002362;
    --alcon-blue-light: #e5f5ff;
    --alcon-blue-bg: #f5f8fd;
    --alcon-blue-tint: #cee0fd;
    --alcon-brand-cyan: #26a3dd;
    --alcon-navy: #042f6c;
    --alcon-text: #232323;
    --alcon-text-muted: #6b6b6b;
    --alcon-bg: #f6f6f7;
    --alcon-bg-warm: #f9f6f1;
    --alcon-border: #e6e8ee;
    --alcon-white: #ffffff;
    --alcon-success: #02a040;
    --alcon-warning: #ffc700;
    --alcon-danger: #cc0000;
    --alcon-radius-btn: 40px;
    --alcon-radius-card: 16px;
    --bs-primary: var(--alcon-blue);
    --bs-primary-rgb: 0, 53, 149;
    --bs-body-font-family: 'Open Sans', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --bs-body-color: var(--alcon-text);
    --bs-link-color: var(--alcon-blue);
    --bs-link-hover-color: var(--alcon-blue-hover);
}

body {
    font-family: var(--bs-body-font-family);
    color: var(--alcon-text);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 300;
    color: var(--alcon-text);
}

/* Buttons – pill shape matching alcon.com CTAs */
.btn {
    border-radius: var(--alcon-radius-btn);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.875rem 2rem;
    line-height: 1.4;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    border-radius: 30px;
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

.btn-primary {
    --bs-btn-bg: var(--alcon-blue);
    --bs-btn-border-color: var(--alcon-blue);
    --bs-btn-hover-bg: var(--alcon-blue-hover);
    --bs-btn-hover-border-color: var(--alcon-blue-hover);
    --bs-btn-active-bg: var(--alcon-blue-pressed);
    --bs-btn-active-border-color: var(--alcon-blue-pressed);
    --bs-btn-focus-shadow-rgb: 0, 53, 149;
}

.btn-outline-primary {
    --bs-btn-color: var(--alcon-blue);
    --bs-btn-border-color: var(--alcon-blue);
    --bs-btn-hover-bg: var(--alcon-blue);
    --bs-btn-hover-border-color: var(--alcon-blue);
    --bs-btn-hover-color: var(--alcon-white);
    --bs-btn-active-bg: var(--alcon-blue-pressed);
    --bs-btn-active-border-color: var(--alcon-blue-pressed);
    --bs-btn-focus-shadow-rgb: 0, 53, 149;
}

.btn-outline-secondary {
    --bs-btn-color: var(--alcon-blue);
    --bs-btn-border-color: var(--alcon-border);
    --bs-btn-hover-bg: var(--alcon-blue-bg);
    --bs-btn-hover-border-color: var(--alcon-blue);
    --bs-btn-hover-color: var(--alcon-blue);
    --bs-btn-active-bg: var(--alcon-blue-tint);
    --bs-btn-active-border-color: var(--alcon-blue);
    --bs-btn-focus-shadow-rgb: 0, 53, 149;
}

.btn-secondary {
    --bs-btn-bg: var(--alcon-white);
    --bs-btn-border-color: var(--alcon-border);
    --bs-btn-color: var(--alcon-blue);
    --bs-btn-hover-bg: var(--alcon-blue-bg);
    --bs-btn-hover-border-color: var(--alcon-blue);
    --bs-btn-hover-color: var(--alcon-blue);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--alcon-radius-card);
    box-shadow: 0 2px 12px rgba(0, 6, 25, 0.06);
}

/* Forms */
.form-control,
.form-select {
    border-color: #bcbcbc;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--alcon-blue);
    box-shadow: 0 0 0 0.2rem rgba(0, 53, 149, 0.15);
}

.form-check-input:checked {
    background-color: var(--alcon-blue);
    border-color: var(--alcon-blue);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(204, 0, 0, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--alcon-text);
}

.phone-input-group .phone-country-select {
    max-width: 11.5rem;
    flex: 0 0 11.5rem;
    padding-left: 0.75rem;
    padding-right: 1.75rem;
}

@media (max-width: 575.98px) {
    .phone-input-group {
        flex-wrap: wrap;
    }

    .phone-input-group .phone-country-select {
        max-width: 100%;
        flex: 1 1 100%;
        border-radius: 8px 8px 0 0 !important;
    }

    .phone-input-group #phone {
        border-radius: 0 0 8px 8px !important;
        margin-left: 0 !important;
        width: 100%;
    }

    .phone-input-group .phone-country-select.is-invalid,
    .phone-input-group #phone.is-invalid {
        z-index: 1;
    }
}

/* Alerts */
.alert-info {
    background-color: var(--alcon-blue-bg);
    border-color: var(--alcon-blue-tint);
    color: var(--alcon-navy);
}

.text-primary {
    color: var(--alcon-blue) !important;
}

.bg-primary {
    background-color: var(--alcon-blue) !important;
}

.text-muted {
    color: var(--alcon-text-muted) !important;
}

/* Site header – Alcon top bar */
.site-header {
    background: var(--alcon-blue);
    height: 50px;
    width: 100%;
    flex-shrink: 0;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px 0 28px;
}

.site-header-logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.site-header-logo img {
    display: block;
    height: 32px;
    width: auto;
}

.site-header-privacy {
    color: var(--alcon-white);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.site-header-privacy:hover {
    color: var(--alcon-white);
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .site-header-inner {
        padding: 0 16px;
    }

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

    .site-header-privacy {
        font-size: 0.8rem;
    }
}

/* Site footer – copyright */
.site-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 24px 28px;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--alcon-text-muted);
}

.site-footer-inner {
    max-width: 720px;
    margin: 0 auto;
}

.site-footer p {
    margin: 0 0 0.65rem;
}

.site-footer p:last-child {
    margin-bottom: 0;
}

.site-footer-alcon {
    font-weight: 600;
    color: var(--alcon-text);
}

.site-footer-sep {
    margin: 0 0.35em;
    color: var(--alcon-text-muted);
}

.site-footer-credit {
    margin-top: 1rem;
    font-size: 0.75rem;
}

.site-footer a {
    color: var(--alcon-blue);
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover {
    color: var(--alcon-blue-hover);
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .site-footer {
        padding: 20px 16px;
        font-size: 0.75rem;
    }

    .site-footer-credit {
        font-size: 0.7rem;
    }
}

/* Consent checkboxes on registration form */
.consent-list {
    border: 1px solid var(--alcon-border);
    border-radius: 12px;
    background: var(--alcon-blue-bg);
    padding: 1rem 1.15rem;
}

.consent-check .form-check-label {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
}

.consent-check .form-check-label a {
    color: var(--alcon-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.consent-check .form-check-label a:hover {
    color: var(--alcon-blue-hover);
}

.consent-intro {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 0;
}

.consent-intro a {
    color: var(--alcon-blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.consent-intro a:hover {
    color: var(--alcon-blue-hover);
}

.consent-notice {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
}

/* Public pages */
body.page-public,
body.page-public-gradient {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.page-public {
    background: var(--alcon-bg);
}

body.page-public-gradient {
    background: linear-gradient(135deg, var(--alcon-blue-bg) 0%, var(--alcon-bg-warm) 100%);
}

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

body.page-centered > .page-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.public-container {
    max-width: 560px;
    margin: 60px auto;
}

/* Home / landing */
.icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--alcon-blue-light);
    color: var(--alcon-blue);
    font-size: 2rem;
}

/* Registration form */
.page-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 16px;
}

.card.info-card {
    --bs-card-bg: #003595;
    background-color: #003595;
    background-image: none;
    color: var(--alcon-white);
    overflow: hidden;
    position: relative;
}

.card.info-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/img/dots1_vertical.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.card.info-card > * {
    position: relative;
    z-index: 1;
}

.info-card .text-soft {
    color: rgba(255, 255, 255, 0.78);
}

.info-card .h2{
    color: #fff !important;
}

.step-panel[hidden] {
    display: none !important;
}

.rank-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid var(--alcon-border);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--alcon-white);
}

.rank-option:hover {
    border-color: var(--alcon-blue-tint);
    background: var(--alcon-blue-bg);
}

.rank-option.is-selected {
    border-color: var(--alcon-blue);
    background: var(--alcon-blue-light);
}

.rank-option.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.rank-badge {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--alcon-white);
    background: var(--alcon-blue);
}

.rank-badge.is-empty {
    background: var(--alcon-border);
    color: transparent;
}

.rank-option .form-check-input {
    margin-top: 0.35rem;
}

.rank-option-body {
    flex: 1;
    min-width: 0;
}

.survey-hint {
    font-size: 0.9rem;
    color: var(--alcon-text-muted);
}

.step-indicator {
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--alcon-text-muted);
}

.other-field[hidden] {
    display: none !important;
}

/* Form message modal */
.form-msg-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.form-msg-modal[hidden] {
    display: none !important;
}

.form-msg-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 47, 108, 0.45);
    backdrop-filter: blur(2px);
}

.form-msg-modal__dialog {
    position: relative;
    width: min(100%, 420px);
    background: var(--alcon-white);
    border-radius: var(--alcon-radius-card);
    box-shadow: 0 18px 48px rgba(0, 35, 98, 0.22);
    padding: 1.75rem 1.5rem 1.5rem;
    animation: form-msg-modal-in 0.22s ease-out;
}

@keyframes form-msg-modal-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.form-msg-modal__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: #fdecec;
    color: var(--alcon-danger);
    font-size: 1.35rem;
}

.form-msg-modal__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--alcon-text);
    margin: 0 0 0.5rem;
}

.form-msg-modal__body {
    margin: 0 0 1.25rem;
    color: var(--alcon-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.form-msg-modal__list {
    margin: 0;
    padding-left: 1.15rem;
}

.form-msg-modal__list li + li {
    margin-top: 0.35rem;
}

.form-msg-modal__actions {
    display: grid;
}

body.form-msg-modal-open {
    overflow: hidden;
}

/* Admin panel */
:root {
    --sidebar-w: 260px;
}

body.page-admin {
    background: var(--alcon-bg);
}

body.page-admin-login {
    background: var(--alcon-navy);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--alcon-blue);
    color: var(--alcon-white);
    padding: 24px 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar .brand {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 16px;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    transition: all 0.15s;
    text-decoration: none;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: var(--alcon-white);
    background: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link.active {
    border-right: 3px solid var(--alcon-brand-cyan);
}

.main-content {
    margin-left: var(--sidebar-w);
    padding: 24px 32px;
    min-height: 100vh;
}

.main-content-scanner {
    margin-left: 0;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.stat-card {
    text-align: center;
    padding: 24px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--alcon-blue);
}

.stat-card .stat-label {
    color: var(--alcon-text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
}

.badge-redeemed {
    background: var(--alcon-success);
}

.badge-pending {
    background: var(--alcon-warning);
    color: var(--alcon-text);
}

.badge-expired {
    background: var(--alcon-danger);
}

.progress-bar-alcon {
    background-color: var(--alcon-blue) !important;
}

.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--alcon-white);
    border-top: 1px solid var(--alcon-border);
    display: flex;
    justify-content: space-around;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 6, 25, 0.06);
}

.mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--alcon-text-muted);
    font-size: 0.62rem;
    padding: 4px 2px;
    flex: 1;
    min-width: 0;
    transition: color 0.15s;
}

.mobile-nav a i {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.mobile-nav a.active {
    color: var(--alcon-blue);
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .main-content {
        margin-left: 0;
        padding: 16px 16px calc(76px + env(safe-area-inset-bottom, 0px));
    }

    .top-bar h4 {
        font-size: 1.1rem;
    }

    .top-bar .user-name {
        display: none;
    }
}
