/* moda Brand Color Variables */
:root {
    --moda-primary-yellow: #FFD700;
    --moda-secondary-gray: #607D8B;
    --text-dark: #333333;
    --background-light: #F5F5F5;
    --status-success: #4CAF50;
    --status-error: #F44336;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background-light);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    border-top: 4px solid var(--moda-primary-yellow);
}

h1 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 28px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* Login View */
#login-view p {
    color: #666;
    margin-bottom: 30px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#user-email {
    color: #667eea;
    font-weight: 500;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
}

.form-help {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--moda-secondary-gray);
    font-style: italic;
}

input[type="text"],
input[type="email"],
input[type="tel"], 
input[type="date"],
input[type="datetime-local"],
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--moda-secondary-gray);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--moda-primary-yellow);
}

/* Textarea specific styles */
textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--moda-primary-yellow);
    color: var(--text-dark);
}

.btn-primary:hover {
    background: #FFC700;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.btn-secondary {
    background: var(--moda-secondary-gray);
    color: white;
}

.btn-secondary:hover {
    background: #546E7A;
    transform: translateY(-2px);
}

/* Error Messages */
.error {
    background: #FFEBEE;
    border: 2px solid var(--status-error);
    color: var(--status-error);
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
}

#submit-button {
    width: 100%;
    margin-top: 10px;
}

/* Button Groups */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

.button-group .btn {
    flex: 0 1 auto;
    min-width: 140px;
    padding: 12px 20px;
}

/* QR Code View */
#qr-code-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

#qr-code-image {
    max-width: 300px;
    width: 100%;
    height: auto;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.instructions {
    text-align: left;
    color: #555;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.instructions h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.instructions ol {
    margin: 15px 0;
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.instructions .note {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    font-size: 14px;
    color: #856404;
}

#new-issuance-button {
    width: 100%;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 24px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }
}
