* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: #222;
}

.container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    padding: 2.5rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
}

h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
}

.subtitle {
    margin: 0 0 1.75rem;
    color: #666;
    font-size: 0.95rem;
}

.qr-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#url-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.15s ease;
}

#url-input:focus {
    outline: none;
    border-color: #667eea;
}

#generate-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #667eea;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

#generate-btn:hover {
    background: #5568d3;
}

#generate-btn:active {
    transform: translateY(1px);
}

.error-message {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fee;
    color: #c33;
    border-radius: 8px;
    font-size: 0.9rem;
}

.result {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.qr-display {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.qr-display canvas,
.qr-display svg {
    max-width: 100%;
    height: auto;
    border: 1px solid #eee;
    border-radius: 8px;
}

.download-area {
    position: relative;
    display: inline-block;
}

.download-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #667eea;
    background: #fff;
    border: 2px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.download-btn:hover {
    background: #667eea;
    color: #fff;
}

.download-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 10;
    min-width: 200px;
}

.download-menu button {
    display: block;
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    text-align: left;
    background: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.1s ease;
}

.download-menu button:hover {
    background: #f5f5fa;
}

.download-menu button + button {
    border-top: 1px solid #eee;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
