/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF6B6B;
    --primary-dark: #E05555;
    --success-color: #4CAF50;
    --danger-color: #F44336;
    --warning-color: #FF9800;
    --neutral-color: #757575;
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-light: #9E9E9E;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --bg-tertiary: #FAFAFA;
    --border-color: #E0E0E0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ebef 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    padding: 20px 0;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Loading State */
.loading-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.error-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
    padding: 40px 20px;
}

.error-icon {
    font-size: 64px;
}

.error-container h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-container p {
    color: var(--text-secondary);
    max-width: 400px;
    margin-bottom: 20px;
}

/* Card */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-header {
    padding: 32px 32px 24px;
    background: linear-gradient(135deg, #FFF5F5 0%, #FFE8E8 100%);
    border-bottom: 1px solid var(--border-color);
}

.warning-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-md);
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.card-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

.card-body {
    padding: 32px;
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 32px;
}

.user-avatar {
    flex-shrink: 0;
}

.user-email {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Critical Warning Banner */
.critical-warning {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #FFF3E0 0%, #FFE0B2 100%);
    border: 2px solid #FF9800;
    border-radius: var(--radius-md);
    margin-bottom: 32px;
    animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 152, 0, 0);
    }
}

.warning-icon {
    font-size: 32px;
    flex-shrink: 0;
    line-height: 1;
}

.warning-content h4 {
    font-size: 16px;
    font-weight: 700;
    color: #E65100;
    margin-bottom: 8px;
}

.warning-content p {
    font-size: 14px;
    color: #424242;
    line-height: 1.6;
}

.warning-content strong {
    color: #D84315;
    font-weight: 700;
}

/* Info Section */
.info-section {
    margin-bottom: 32px;
}

.info-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-list li {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.icon-circle.loss {
    background: #FFEBEE;
}

.icon-circle.keep {
    background: #E8F5E9;
}

.icon-circle.neutral {
    background: var(--bg-secondary);
}

.info-list strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.info-list p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Form Section */
.form-section {
    margin-bottom: 32px;
}

.form-section label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-section textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.2s;
}

.form-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #D32F2F;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: #E0E0E0;
}

/* Actions */
.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.actions .btn {
    width: 100%;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 480px;
    width: 100%;
    animation: slideUp 0.3s;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-actions .btn {
    width: 100%;
}

.btn-spinner {
    display: inline-flex;
}

/* Success Page */
.success-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
}

.success-icon {
    display: flex;
    justify-content: center;
    margin: 32px 0;
}

.success-content {
    text-align: center;
}

.success-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.info-box {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 24px;
    margin: 24px 0;
    text-align: left;
}

.info-box.secondary {
    background: #E3F2FD;
    border-left: 4px solid #2196F3;
}

.info-box h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.success-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.success-list li {
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: 24px;
    position: relative;
}

.info-list-simple {
    list-style: disc;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-list-simple li {
    font-size: 14px;
    color: var(--text-secondary);
}

.support-section,
.feedback-section {
    margin: 32px 0;
}

.support-section h3,
.feedback-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.support-section p,
.feedback-section p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.alt-actions {
    text-align: center;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.alt-actions p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.links {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.links a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 32px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer p {
    font-size: 14px;
    color: var(--text-secondary);
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-links {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-links .separator {
    color: var(--text-light);
    user-select: none;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Login Container */
.login-container {
    padding: 40px 20px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input::placeholder {
    color: var(--text-light);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-secondary);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
}

.help-text {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.help-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF5350;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #66BB6A;
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border: 1px solid #42A5F5;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .card-header,
    .card-body {
        padding: 24px;
    }

    .card-header h2 {
        font-size: 24px;
    }

    .success-content h2 {
        font-size: 24px;
    }

    .modal-content {
        padding: 24px;
    }

    .modal-content h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 20px;
    }

    .card-header,
    .card-body {
        padding: 20px;
    }

    .warning-badge {
        font-size: 12px;
        padding: 6px 12px;
    }

    .info-list li {
        flex-direction: column;
    }

    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}
