:root {
    --primary-color: #6750A4;
    --on-primary: #FFFFFF;
    --surface-container-highest: #E6E0E9;
    --on-surface: #1C1B1F;
    --outline: #79747E;
    --background: #FEF7FF;
    --card-bg: #F7F2FA;
    --shadow-1: 0 1px 2px 0 rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15);
    --shadow-2: 0 1px 2px 0 rgba(0,0,0,.3), 0 2px 6px 2px rgba(0,0,0,.15);
}

html.dark {
    --primary-color: #D0BCFF;
    --on-primary: #381E72;
    --surface-container-highest: #4A4458;
    --on-surface: #E6E1E5;
    --outline: #938F99;
    --background: #141218;
    --card-bg: #211F26;
}

* { box-sizing: border-box; }

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    background-color: var(--background);
    color: var(--on-surface);
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 500px;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

header .logo {
    width: 64px;
    height: 64px;
    margin-bottom: 0.5rem;
}

header h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin: 0;
}

header p {
    font-size: 1rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

#theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--on-surface);
}

.card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: var(--shadow-1);
    margin-bottom: 1.5rem;
}

.access-card {
    display: flex;
}

input[type="text"], input[type="url"], input[type="password"], textarea, select {
    width: 100%;
    font-size: 1rem;
    padding: 12px 16px;
    border: 1px solid var(--outline);
    border-radius: 8px;
    background-color: transparent;
    color: var(--on-surface);
    outline: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--primary-color);
}
textarea { resize: vertical; }

#access-code {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

#go-btn {
    padding: 12px 16px;
    border: 1px solid var(--outline);
    background-color: var(--surface-container-highest);
    color: var(--on-surface);
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-weight: 500;
}

.tabs {
    display: flex;
    margin-bottom: 1rem;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--outline);
    color: var(--on-surface);
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.7;
}
.tab-btn.active {
    border-bottom-color: var(--primary-color);
    opacity: 1;
    font-weight: bold;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

#file-input {
    width: 100%;
    padding: 10px;
    border: 1px dashed var(--outline);
    border-radius: 8px;
}
.file-info {
    font-size: 0.8rem;
    text-align: center;
    opacity: 0.7;
    margin-top: 0.5rem;
}

.options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
    align-items: center;
}

.options select,
.options label {
    grid-column: span 2;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231C1B1F'%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;
}

html.dark select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23E6E1E5'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
}

.options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 0;
}

@media (max-width: 400px) {
    .options { grid-template-columns: 1fr; }
    .options select,
    .options label {
        grid-column: auto;
    }
}

#turnstile-widget { margin-top: 1.5rem; }

.create-btn {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 500;
    background-color: var(--primary-color);
    color: var(--on-primary);
    border: none;
    border-radius: 28px;
    cursor: pointer;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-2);
    transition: filter 0.2s;
}
.create-btn:hover { filter: brightness(1.1); }
.create-btn:disabled {
    background-color: var(--outline);
    cursor: not-allowed;
    box-shadow: none;
}

.result-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: center;
}
.result-link-container { display: flex; margin-bottom: 1rem; }
#result-url {
    border-radius: 8px 0 0 8px;
    background: var(--surface-container-highest);
}
#copy-btn {
    padding: 12px;
    border: 1px solid var(--outline);
    background-color: var(--primary-color);
    color: var(--on-primary);
    border-radius: 0 8px 8px 0;
    cursor: pointer;
}
#qrcode { display: flex; justify-content: center; margin-bottom: 1rem; }
#qrcode img { border-radius: 8px; background: white; padding: 5px; }

.error-card {
    background-color: #B3261E;
    color: #FFFFFF;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.5rem;
    text-align: center;
}

footer {
    text-align: center;
    margin-top: 3rem;
    font-size: 0.9rem;
    opacity: 0.6;
}