:root {
    --bg-main: #E0D4BC;
    --accent-green: #327A68;
    --dark-ui: #0E2B28;
    --beige-soft: #CABD9C;
    --white: #FFFFFF;
    --ultra-light: #F9F8F2;
    --font-main: 'Montserrat', sans-serif;
    --font-headings: 'Bebas Neue', 'Montserrat', sans-serif;
    --border-radius: 10px;
    --card-border: 1px solid #CABD9C;
    --padding-default: 16px;
    /* Legacy variables for compatibility */
    --font: Montserrat, sans-serif;
    --panel: #151923;
    --text: #5c5c5c;
    --table-head-color: #6f6f6f;
    --main-color: #D9C4A1;
    --main-color-alt: #CABD9C;
    --line-height: 28px;
    --font-size: 18px;
    --font-weight: 400;
    --header-h: 50px;
    --header-text-color: #c1ae8f;
    --header-bg: #0E2B28;
    --background-color: #E0D4BC;
    --table-border: #CABD9C;
}
body {
    font-family: var(--font);
    font-size: var(--font-size);
    line-height: var(--line-height);
    font-weight: var(--font-weight);
    background-color: var(--background-color);
}

/* Sticky footer layout for login pages */
body.login-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

body.login-page .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}


.header {
    background-color: var(--header-bg);
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}
.main-container {
    padding: 20px;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-direction: column;
    background-color: var(--background-color);
}

.auth-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.auth-container-header {
    line-height: 1.5;
    font-size: 24px;
    color: var(--dark-ui);
    text-align: left;
    padding: 0 20px;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Links should use accent-green */
a {
    color: var(--accent-green);
    text-decoration: none;
}

a:hover {
    color: var(--dark-ui);
    text-decoration: underline;
}

.auth-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Match cabinet styles */
.container-row {
    padding: 0 20px;
}

.title {
    padding: 0 20px;
    margin: 40px auto 30px;
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-ui);
    text-transform: uppercase;
    text-align: center;
    max-width: 750px;
    font-family: var(--font-headings);
}

.card-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    width: 100%;
    padding: 0 20px;
    margin-bottom: 20px;
}

/* Registration form - limit card width on desktop */
.auth-container .card-group {
    grid-template-columns: 1fr;
    max-width: 750px;
    margin: 0 auto;
}

.card-wrapper {
    border: var(--card-border);
    border-radius: var(--border-radius);
    padding: var(--padding-default);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: var(--dark-ui);
    background-color: var(--white);
}

.card-header {
    position: relative;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.card-body {
    padding: 0;
}

.section-content {
    padding-top: 10px;
}

.divider {
    height: 1px;
    background: var(--table-border);
    margin: 8px 0 16px;
}

.mb-10 {
    margin-bottom: 10px;
}

/* Registration Instructions - matches cabinet card style */
.registration-instructions {
    margin: 20px 0;
    padding: 16px;
    background-color: var(--white);
    border: 1px solid var(--beige-soft);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--dark-ui);
}

.registration-instructions .card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--dark-ui);
    margin-bottom: 12px;
    padding: 0;
}

.instructions-icon {
    font-size: 18px;
    line-height: 1;
}

.instructions-list {
    margin: 0 0 16px 0;
    padding-left: 24px;
    list-style-type: disc;
    color: rgba(0, 0, 0, 0.7);
}

.instructions-list li {
    margin-bottom: 8px;
    padding-left: 4px;
}

.instructions-list li:last-child {
    margin-bottom: 0;
}

.instructions-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background-color: var(--ultra-light);
    border-left: 3px solid var(--accent-green);
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.7);
}

.instructions-note .instructions-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .registration-instructions {
        margin: 16px 0;
        padding: 14px;
        font-size: 13px;
    }
    
    .registration-instructions .card-header {
        font-size: 15px;
    }
    
    .instructions-list {
        padding-left: 20px;
        font-size: 13px;
    }
    
    .instructions-note {
        padding: 10px 12px;
        font-size: 13px;
    }
}

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}
.input-container {
    display: flex;
    width: 100%;
}

.input-container label {
    display: block;
}

.input-wrapper {
    display: flex;
    gap: 6px;
    width: 100%;
    flex-wrap: wrap;
}

.input-wrapper > label {
    flex: 0 0 100%;
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 16px;
}

.input-wrapper > label::after {
    content: "*";
    color: red;
    margin-left: 4px;
    font-weight: 300;
}

.input-wrapper .input-container {
    flex: 1 1 0;
    min-width: 220px;
}

/* Field error state */
.input-container input.error,
.input-container textarea.error,
.input-container select.error {
    border-color: #ef4444;
    box-shadow: none;
}

/* removed old .date-selectors styles (replaced by Air Datepicker) */

.form input[type="text"],
.form input[type="password"],
.form input[type="date"],
.form input[type="email"],
.form button,
.form select {
    width: 100%;
    box-sizing: border-box;
    color: rgba(0,0,0, .7);
    padding: 5px 14px;
    font-size: 16px;
    border: 1px solid rgba(0,0,0, .25);
    border-radius: 3px;
    background-color: #fff;
}

.form input[type="text"],
.form input[type="password"],
.form input[type="date"],
.form select {
    height: 43px;
}

/* removed old select#country tweak (replaced by custom dropdown) */

/* Custom country dropdown (short scrollable panel) */
.select-enhanced { position: relative; }
.select-enhanced .select-hidden { display: none; }
.select-enhanced,
.select-enhanced .select-display,
.select-enhanced .select-menu { width: 100%; }
.select-enhanced .select-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 12px;
    font-size: 16px;
    color: rgba(0,0,0,.7);
    border: 1px solid rgba(0,0,0,.25);
    border-radius: 3px;
    background: #fff !important;
    cursor: pointer;
}
.select-enhanced[aria-expanded="true"] .select-display {
    box-shadow: 0 0 0 1px var(--accent-green), 0 1px 2px rgba(0,0,0,.15);
    border-color: var(--accent-green);
    background: #fff;
}
.select-enhanced .select-menu {
    position: absolute;
    left: 0; right: 0; top: calc(100% + 4px);
    z-index: 50;
    background: #fff !important;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    max-height: 220px; /* Control total scroll height */
    overflow: auto;
}
.select-enhanced .select-option {
    padding: 8px 10px;
    font-size: 16px;
    cursor: pointer;
}
.select-enhanced .select-option:hover,
.select-enhanced .select-option[aria-selected="true"] {
    background: #f4f4f4 !important;
}

.form input[type="text"]:hover,
.form input[type="text"]:focus,
.form input[type="password"]:hover,
.form input[type="password"]:focus,
.form input[type="date"]:hover,
.form input[type="date"]:focus,
.form input[type="email"]:hover,
.form input[type="email"]:focus,
.form select:hover,
.form select:focus {
    border-color: var(--accent-green);
    outline: none;
    height: 43px;
    box-shadow: 0 0 0 1px var(--accent-green), 0 1px 2px rgba(0,0,0,.15);
}

.form button {
    background: var(--accent-green);
    color: var(--white);
    font-weight: 600;
    border: 2px solid var(--accent-green);
    cursor: pointer;
    transition:
            background 0.2s ease,
            border-color 0.6s ease,
            opacity 0.2s ease;
    height: 41px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.form button:hover:not(:disabled) {
    background: var(--dark-ui);
    color: var(--white);
    border-color: var(--dark-ui);
}

.form button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.form button.loading {
    cursor: wait;
    opacity: 0.7;
}

/* Loading spinner */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/*----------helpers---------*/

.w-20 {
    width: 20px;
}

.w-600 {
    width: 600px;
}

.mw-600 {
    max-width: 600px;
}
.mw-400 {
    max-width: 400px;
}
.mt-20 {
    margin-top: 20px;
}
.mb-20 {
    margin-bottom: 20px;
}

.ml-10 {
    margin-left: 10px;
}
.mr-10 {
    margin-right: 10px;
}
.mb-10 {
    margin-bottom: 10px;
}
.mt-10 {
    margin-top: 10px;
}
.hidden {
    display: none !important;
}

.inderline {
    text-decoration: underline;
}

.fs-16 {
    font-size: 16px;
}

@media (max-width: 768px) {
    /* Registration form - reduce horizontal spacing on mobile */
    .auth-container .container-row {
        padding: 0 8px;
    }
    
    .auth-container .card-group {
        padding: 0 8px;
        gap: 12px;
    }
    
    .auth-container .card-wrapper {
        padding: 12px;
    }
    
    .auth-container .title {
        padding: 0 8px;
        margin: 12px auto 8px;
        max-width: 100%;
    }
    
    .main-container {
        padding: 12px 8px;
    }

    .auth-card {
        padding: 10px;
        max-width: 100%;
    }

    .input-wrapper {
        flex-direction: column;
        gap: 10px;
    }

    .form button {
        width: 100%;
    }

    .main-container {
        /*justify-content: flex-start;*/
        align-items: stretch;
        padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
    }
    .auth-container {
        margin: 16px auto;
    }
    .auth-container-header {
        font-size: 22px;
        padding: 14px;
    }
    .auth-text {
        padding: 16px;
    }
}

/* Footer styles for login pages */
body.login-page .cabinet-footer {
    margin-top: auto;
    padding: 20px 0;
    border-top: 1px solid rgba(14, 43, 40, 0.1);
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: var(--dark-ui);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--accent-green);
    text-decoration-thickness: 2px;
}

.footer-separator {
    color: rgba(14, 43, 40, 0.4);
    font-size: 14px;
}

.footer-version {
    font-size: 11px;
    color: rgba(14, 43, 40, 0.5);
    letter-spacing: 0.5px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .footer-content {
        padding: 0 16px;
    }
    
    .footer-links {
        font-size: 13px;
    }
    
    .footer-version {
        font-size: 10px;
    }
}
