/**
 * HostMetrics Public Components CSS
 *
 * Shared styles for all public pages (login, register, etc.)
 * Includes: Header, Footer, Language Dropdown, Auth Forms
 *
 * @version 1.0.0
 * @since 2026-02-02
 */

/* ===========================================
   CSS Variables
   =========================================== */
:root {
    --primary: #FF385C;
    --primary-dark: #E31C5F;
    --primary-gradient: linear-gradient(to right, #E61E4D, #E31C5F, #D70466);
    --text-primary: #222222;
    --text-secondary: #717171;
    --text-light: #6A6A6A;
    --border-color: #DDDDDD;
    --bg-light: #F7F7F7;
    --white: #FFFFFF;
    --error: #C13515;
    --success: #008A05;
}

/* ===========================================
   Font Face (Airbnb Cereal)
   =========================================== */
@font-face {
    font-family: 'Airbnb Cereal';
    src: url('/fonts/AirbnbCereal_W_Lt.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Airbnb Cereal';
    src: url('/fonts/AirbnbCereal_W_Bk.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Airbnb Cereal';
    src: url('/fonts/AirbnbCereal_W_Md.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Airbnb Cereal';
    src: url('/fonts/AirbnbCereal_W_Bd.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Airbnb Cereal';
    src: url('/fonts/AirbnbCereal_W_XBd.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ===========================================
   Base Styles
   =========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Airbnb Cereal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.5;
    background: var(--white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===========================================
   Public Header
   =========================================== */
.public-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.public-nav {
    max-width: 1280px;
    margin: 0 auto;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 8px;
    transition: background 0.2s;
}

.nav-link:hover {
    background: var(--bg-light);
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===========================================
   Language Dropdown
   =========================================== */
.language-dropdown {
    position: relative;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: 1px solid #E5E7EB;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.dropdown-trigger:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.icon-chevron {
    transition: transform 0.15s;
}

.language-dropdown.open .icon-chevron {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 4px;
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s;
    z-index: 9999;
}

.language-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    border-radius: 4px;
    text-decoration: none;
}

.dropdown-menu a:hover {
    background: #F3F4F6;
}

.dropdown-menu a.active {
    background: #EEF2FF;
    color: #4F46E5;
}

/* ===========================================
   Public Footer
   =========================================== */
.public-footer {
    background: var(--bg-light);
    padding: 48px 24px 24px;
    margin-top: auto;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    margin-bottom: 32px;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 8px;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    max-width: 1280px;
    margin: 0 auto;
}

.footer-bottom span {
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-legal {
    display: flex;
    gap: 24px;
}

.footer-legal a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-legal a:hover {
    color: var(--text-primary);
}

/* ===========================================
   Auth Pages (Login, Register, etc.)
   =========================================== */
.auth-page {
    background: var(--bg-light);
}

.auth-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.auth-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-card h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 56, 92, 0.1);
}

.form-group input::placeholder {
    color: #B0B0B0;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.forgot-link {
    font-size: 14px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-block {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-error {
    background: #FEF2F2;
    color: var(--error);
    border: 1px solid #FECACA;
}

.alert-success {
    background: #F0FDF4;
    color: var(--success);
    border: 1px solid #BBF7D0;
}

.alert-info {
    background: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
}

/* Terms Checkbox */
.terms-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.terms-text a {
    color: var(--primary);
    text-decoration: none;
}

.terms-text a:hover {
    text-decoration: underline;
}

/* ===========================================
   Legal Notice Box (for German users on English legal pages)
   =========================================== */
.legal-notice {
    background: #f0f4f8;
    border-left: 4px solid #3b82f6;
    padding: 12px 16px;
    margin-bottom: 24px;
    border-radius: 4px;
    font-size: 14px;
    color: #475569;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.legal-notice p {
    margin: 0;
}

/* ===========================================
   Responsive
   =========================================== */
@media (max-width: 768px) {
    .public-header {
        padding: 0 16px;
    }

    .public-nav {
        height: 56px;
    }

    .nav-right {
        gap: 8px;
    }

    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }

    .btn-primary {
        padding: 8px 16px;
        font-size: 13px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .auth-card {
        padding: 32px 24px;
    }

    .auth-card h1 {
        font-size: 24px;
    }
}
