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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.4;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 390px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 15px;
}

h1 {
    font-size: 1.3rem;
    color: #667eea;
    margin-bottom: 5px;
}

.greeting {
    font-size: 0.85rem;
    color: #666;
}

#uuid-display {
    font-weight: 600;
    color: #764ba2;
    font-family: 'Courier New', monospace;
}

main {
    margin-bottom: 15px;
}

fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
}

legend {
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    padding: 0 6px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.radio-label:hover {
    background-color: #f5f5f5;
}

.radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
}

.radio-label span {
    font-size: 0.85rem;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
    font-size: 0.85rem;
}

.input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0 8px;
    transition: border-color 0.3s;
}

.currency {
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    margin-right: 6px;
}

input[type="text"],
input[type="password"] {
    flex: 1;
    border: none;
    padding: 8px 0;
    font-size: 0.9rem;
    outline: none;
}

input[type="password"],
input[type="text"]#moving-to {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
}

.submit-btn {
    width: 100%;
    padding: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.message {
    margin-top: 12px;
    padding: 10px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.85rem;
    text-align: center;
    display: none;
}

.message.show {
    display: block;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Poll Summary */
.poll-summary {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

/* F.U. percentage box */
.fu-box {
    margin-top: 15px;
    padding: 12px;
    background-color: #ff4444;
    color: white;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
}

.poll-summary h2 {
    font-size: 1rem;
    color: #667eea;
    margin-bottom: 12px;
    text-align: center;
}

.summary-section {
    margin-bottom: 15px;
}

.summary-section:last-child {
    margin-bottom: 0;
}

.summary-section h3 {
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
}

.vote-bar {
    margin-bottom: 8px;
}

.vote-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 3px;
}

.vote-bar-graph {
    height: 18px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.vote-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 5px;
}

.vote-bar-count {
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.8rem;
    border-bottom: 1px solid #e0e0e0;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: #666;
    font-weight: 500;
}

.stat-value {
    color: #333;
    font-weight: 600;
}

footer {
    text-align: center;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.privacy-notice {
    font-size: 0.7rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 10px;
}

.raw-data {
    font-size: 0.65rem;
    color: #999;
    line-height: 1.5;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-word;
    text-align: left;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .greeting {
        font-size: 0.95rem;
    }

    fieldset {
        padding: 15px;
    }

    .radio-label {
        padding: 10px;
    }

    .submit-btn {
        padding: 12px;
        font-size: 1rem;
    }
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Focus styles for accessibility */
input[type="radio"]:focus,
input[type="text"]:focus,
input[type="password"]:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

button:focus {
    outline: 2px solid #764ba2;
    outline-offset: 2px;
}
