:root {
    --bg-color: #0a0a0a;
    --card-bg: rgba(255, 255, 255, 0.03);
    --text-color: #e5e5e5;
    --accent-color: #d4af37;
    /* Gold */
    --accent-hover: #fcd34d;
    --error-color: #ef4444;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, hsla(45, 20%, 10%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(0, 0%, 15%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(45, 20%, 10%, 1) 0, transparent 50%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

.container {
    width: 100%;
    padding: 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.login-card {
    max-width: 400px;
    margin: 0 auto;
}

.home-content {
    max-width: 900px;
    margin: 0 auto;
}

.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

input[type="password"]:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

button {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent-color);
    color: #0a0a0a;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

#error-msg {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 1rem;
    min-height: 1.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#error-msg.visible {
    opacity: 1;
}

/* Home Page Specifics */
.home-content {
    max-width: 900px;
    text-align: left;
    padding: 3rem;
}

.hero-section {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-bottom: 3rem;
}

.app-icon-wrapper {
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    border-radius: 22%;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.app-icon-wrapper::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 22%;
    padding: 1px;
    background: linear-gradient(to bottom right, rgba(212, 175, 55, 0.5), rgba(255, 255, 255, 0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.app-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18%;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, #d4af37);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text .tagline {
    font-size: 1.25rem;
    color: #a3a3a3;
    margin-bottom: 2rem;
    font-weight: 300;
}

.download-buttons {
    display: flex;
    gap: 1rem;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: start;
    /* Align left to match text */
    margin-top: 1.5rem;
    width: 100%;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: white;
    color: black;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    width: auto;
    max-width: 100%;
    opacity: 1;
    visibility: visible;
    min-width: 10px;
    min-height: 10px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    background: #f8fafc;
}

.download-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    opacity: 1;
}

.download-btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.2);
}

.download-btn svg {
    width: 24px;
    height: 24px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    border-color: rgba(212, 175, 55, 0.3);
}

.feature-card h3 {
    color: #e5e5e5;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.feature-card p {
    color: #a3a3a3;
    font-size: 0.9rem;
    margin-bottom: 0;
}

.logout-btn {
    margin-top: 3rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    width: auto;
    padding: 0.5rem 1.5rem;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
}

/* Language Switcher Styles */
.language-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lang-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-weight: normal;
    padding: 0;
    font-family: inherit;
    font-size: 0.9rem;
}

.language-switcher span {
    color: #333;
    user-select: none;
}

@media (max-width: 768px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .home-content {
        padding: 1.5rem;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .download-buttons {
        flex-direction: column;
        /* Stack on mobile if needed, or keep row if they fit */
        width: 100%;
    }

    .download-btn {
        width: 100%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bloom Effect */
#hero-section {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    padding: 2rem;
    margin: 0 0 3rem 0;
    padding: 1rem;
}

#bloom-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    mix-blend-mode: screen;
}

.app-icon-wrapper,
.hero-text {
    position: relative;
    z-index: 1;
}

/* Beta Form Styles */
.beta-signup-form {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 400px;
}

.beta-signup-form h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.beta-signup-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5em;
}

.beta-signup-form select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.beta-signup-form select option {
    background-color: #1a1a1a;
    color: white;
}

.submit-btn {
    margin-top: 0.5rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #1a1a1a;
    padding: 2.5rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: scale(0.95);
    transition: all 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.modal-content p {
    color: #a3a3a3;
    margin-bottom: 1.5rem;
}

/* Fix for close button inheriting generic button styles */
button.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    width: auto;
    height: auto;
    line-height: 1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

button.close-modal:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: none;
}

/* Modal Input Styling */
.modal-content input[type="email"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.modal-content input[type="email"]:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.container {
    position: relative;
}

@media (max-width: 768px) {
    .language-switcher {
        position: relative;
        top: auto;
        right: auto;
        justify-content: center;
        margin-bottom: 2rem;
        width: 100%;
    }
}

/* Premium Language Dropdown */
.language-dropdown {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 100;
}

.lang-drop-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e5e5e5;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    /* Override generic button styles if needed */
    width: auto;
    font-weight: 500;
}

.lang-drop-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(212, 175, 55, 0.5);
    color: var(--accent-color);
    transform: translateY(-1px);
}

.lang-drop-btn svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.lang-drop-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    min-width: 140px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    overflow: hidden;
    flex-direction: column;
    padding: 0.25rem;
}

.lang-drop-content.show {
    display: flex;
    animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-drop-content a {
    color: #a3a3a3;
    padding: 0.6rem 1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-radius: 0.25rem;
}

.lang-drop-content a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

.lang-drop-content a img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .language-dropdown {
        position: absolute;
        /* Keep absolute even on mobile for better placement */
        top: 1rem;
        right: 1rem;
    }
}