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

:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #e94560;
    --text-color: #eaeaea;
    --text-muted: #a0a0a0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--primary-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Navigation */
header {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background-color: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.logo-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav > ul > li {
    position: relative;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--accent-color);
}

/* Submenu */
.submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--secondary-color);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 180px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    flex-direction: column;
    gap: 0;
    margin-top: 0.5rem;
}

.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
}

.submenu li {
    width: 100%;
}

.submenu a {
    display: block;
    padding: 0.75rem 1.25rem;
    white-space: nowrap;
}

.submenu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 5%;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-color), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(233, 69, 96, 0.3);
}

/* Sections */
section {
    padding: 5rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* Product Section */
.product-section {
    text-align: center;
    background: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border-radius: 20px;
    padding: 4rem 2rem;
}

.product-tagline {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.product-details {
    max-width: 600px;
    margin: 0 auto;
}

.product-details p {
    margin-bottom: 2rem;
    line-height: 1.8;
}

.app-store-link img {
    height: 50px;
    transition: transform 0.3s;
}

.app-store-link:hover img {
    transform: scale(1.05);
}

/* Contact Section */
#contact a {
    color: var(--accent-color);
    text-decoration: none;
}

#contact a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--secondary-color);
    color: var(--text-muted);
}

/* TestFlight Page */
.testflight-hero {
    padding-top: 120px;
    text-align: center;
    padding-bottom: 2rem;
}

.testflight-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-color), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.testflight-hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.testflight-form-section {
    padding-top: 0;
}

.testflight-form {
    max-width: 500px;
    margin: 0 auto;
    background-color: var(--secondary-color);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a0a0a0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.form-group select option {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.checkbox-group {
    margin-bottom: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.checkbox-label a {
    color: var(--accent-color);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

.submit-button {
    width: 100%;
    padding: 1rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    margin-top: 1rem;
}

.submit-button:hover {
    background-color: #d63850;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.form-message {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.form-message.success {
    display: block;
    background-color: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.form-message.error {
    display: block;
    background-color: rgba(233, 69, 96, 0.2);
    color: #e94560;
    border: 1px solid rgba(233, 69, 96, 0.3);
}

/* Login Page */
.login-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
}

.login-container {
    background-color: var(--secondary-color);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-container h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.oauth-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

.oauth-button:hover {
    transform: translateY(-2px);
}

.oauth-button.google {
    background-color: #fff;
    color: #333;
}

.oauth-button.google:hover {
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.2);
}

.oauth-button.apple {
    background-color: #000;
    color: #fff;
}

.oauth-button.apple:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
}

.login-divider span {
    padding: 0 1rem;
    font-size: 0.85rem;
}

.login-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-note a {
    color: var(--accent-color);
    text-decoration: none;
}

.login-note a:hover {
    text-decoration: underline;
}

/* User avatar in nav */
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--secondary-color);
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.modal-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
}

.modal-divider::before,
.modal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
}

.modal-divider span {
    padding: 0 1rem;
    font-size: 0.85rem;
}

.skip-button {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-color);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.skip-button:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Invite Page */
.invite-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 120px 20px 40px;
}

.invite-header {
    text-align: center;
    margin-bottom: 2rem;
}

.invite-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.invite-header p {
    color: var(--text-muted);
}

.invite-panel {
    background: var(--secondary-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.invite-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.stat {
    padding: 1rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.generate-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.generate-btn:hover {
    background: #d63850;
}

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.codes-list {
    margin-top: 2rem;
}

.codes-list h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.code-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--primary-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.code-value {
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: bold;
}

.code-status {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.code-status.available {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.code-status.used {
    background: rgba(160, 160, 160, 0.2);
    color: var(--text-muted);
}

.copy-btn {
    padding: 0.4rem 0.8rem;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 4px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.85rem;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.2);
}

.no-codes {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.not-eligible {
    text-align: center;
    padding: 3rem;
}

.not-eligible h2 {
    margin-bottom: 1rem;
}

.not-eligible a {
    color: var(--accent-color);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    nav ul {
        gap: 1rem;
    }

    .testflight-hero h1 {
        font-size: 2.2rem;
    }

    .testflight-form {
        padding: 1.5rem;
        margin: 0 1rem;
    }
}
