/* Microsoft Fluent Design inspired styles */
:root {
    --primary-color: #0078d4;
    --primary-hover: #106ebe;
    --success-color: #107c10;
    --error-color: #d13438;
    --background: #f3f2f1;
    --card-background: #ffffff;
    --text-primary: #323130;
    --text-secondary: #605e5c;
    --border-color: #edebe9;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 8px 16px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    width: 100%;
    max-width: 480px;
}

.card {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 48px 40px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
}

.microsoft-logo {
    width: 44px;
    height: 44px;
    margin-bottom: 16px;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Views */
.view {
    text-align: center;
}

.view.hidden {
    display: none;
}

.description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 32px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s ease;
    min-width: 200px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    background: #005a9e;
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background: rgba(0, 120, 212, 0.04);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Info Box */
.info-box {
    margin-top: 32px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 4px;
    text-align: left;
}

.info-box h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.info-box ul {
    list-style: none;
    color: var(--text-secondary);
    font-size: 13px;
}

.info-box li {
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
}

.info-box li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* Loading */
.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success View */
.success-icon {
    margin-bottom: 16px;
}

.success-icon svg {
    width: 64px;
    height: 64px;
}

.user-email {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

.code-container {
    background: linear-gradient(135deg, #f0f9ff 0%, #e8f4ff 100%);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.code-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--primary-color);
}

.btn-copy {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.1s ease;
}

.btn-copy:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.btn-copy svg {
    width: 20px;
    height: 20px;
    display: block;
}

.copy-feedback {
    color: var(--success-color);
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    transition: opacity 0.2s ease;
}

.copy-feedback.hidden {
    opacity: 0;
}

/* Instructions */
.instructions {
    text-align: left;
    padding: 20px;
    background: #fafafa;
    border-radius: 4px;
    margin-bottom: 24px;
}

.instructions h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.instructions ol {
    margin-left: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.instructions li {
    padding: 4px 0;
}

.expiry-notice {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Error View */
.error-icon {
    margin-bottom: 16px;
}

.error-icon svg {
    width: 64px;
    height: 64px;
}

.error-message {
    color: var(--error-color);
    font-size: 14px;
    margin-bottom: 24px;
}

/* Footer */
.footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.footer a {
    font-size: 12px;
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 520px) {
    .card {
        padding: 32px 24px;
    }
    
    .code {
        font-size: 28px;
        letter-spacing: 2px;
    }
}
