/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Container */
.container {
    width: 100%;
    max-width: 500px;
}

/* Login card */
.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* Logo */
.logo-container {
    margin-bottom: 30px;
}

.logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

/* Typography */
.title {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

/* Vault specific styles */
.vault-page {
    text-align: center;
    padding: 40px 20px;
}

.vault-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.vault-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
    white-space: pre-line;
}

.partner-message {
    margin-bottom: 30px;
}

.partner-message .vault-title {
    color: #0066cc;
    margin-bottom: 15px;
}

.partner-message .vault-subtitle {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

.default-message {
    margin-bottom: 30px;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
}

.loading-container p {
    color: #666;
    font-size: 14px;
}

.vault-content {
    margin: 30px 0;
}

.personas-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.persona-card {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.persona-card:hover {
    border-color: #0066cc;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.1);
}

.persona-card.selected {
    border-color: #0066cc;
    background: #e6f3ff;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.persona-card.selected::after {
    content: "✓";
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    background: #0066cc;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.persona-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.persona-id {
    font-size: 12px;
    color: #999;
    font-family: monospace;
    margin-bottom: 10px;
}

.persona-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 40px 20px;
    color: #666;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.empty-state p {
    font-size: 14px;
    text-align: center;
    max-width: 250px;
}

.vault-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.secondary-button:hover {
    background: #e9ecef;
    border-color: #0066cc;
    color: #0066cc;
    transform: translateY(-1px);
}

.secondary-button svg {
    width: 16px;
    height: 16px;
}

/* Form */
.login-form {
    text-align: left;
}

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

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

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-input:focus {
    outline: none;
    border-color: #0066cc;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-input::placeholder {
    color: #999;
}

/* Button */
.login-button {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

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

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

/* Message */
.message {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: none;
}

.message::before {
    content: '';
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.message.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

.message.success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23155724'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
}

.message.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.message.error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23721c24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z'/%3E%3C/svg%3E");
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced form validation styles */
.form-group.error .form-input {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group.error .form-label {
    color: #dc3545;
}

.form-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: fadeIn 0.3s ease-out;
}

.form-error::before {
    content: '⚠';
    font-size: 14px;
}

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

/* Responsive design */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .login-card {
        padding: 30px 20px;
        border-radius: 16px;
    }
    
    .title {
        font-size: 24px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .logo {
        width: 60px;
        height: 60px;
    }
    
    .form-input {
        padding: 10px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .login-button {
        padding: 12px 16px;
    }
    
    .persona-card {
        padding: 15px;
    }
    
    .persona-name {
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 25px 15px;
    }
    
    .title {
        font-size: 22px;
    }
    
    .logo {
        width: 50px;
        height: 50px;
    }
}

/* Success and failure pages */
.result-page {
    text-align: center;
    padding: 40px 20px;
}

.result-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

.result-icon svg {
    display: block;
    margin: 0 auto;
}

.result-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.result-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.error-details {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 30px;
    text-align: left;
}

.error-code {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #dc3545;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-help {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.back-button {
    display: inline-block;
    padding: 12px 24px;
    background: #0066cc;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: #0052a3;
    transform: translateY(-2px);
} 