/* auth_external.css - Komplette finale Version für externe Auth-Seiten */

/* ==========================================
   RESET & BASICS
   ========================================== */

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

html {
    height: 100%;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

body {
    min-height: 100%;
    font-family: inherit;
    overflow-x: hidden;
    overflow-y: auto;
}

/* ==========================================
   ANIMATED BACKGROUND
   ========================================== */

body {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c, #4facfe, #00f2fe);
    background-size: 400% 400%;
    background-attachment: fixed;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating particles effect - fixed position to avoid scroll issues */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.1) 2px, transparent 2px),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 2px, transparent 2px),
        radial-gradient(circle at 40% 40%, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 200px 200px, 300px 300px, 150px 150px;
    animation: floatParticles 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes floatParticles {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}

/* ==========================================
   MAIN CONTAINER
   ========================================== */

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 10;
}

/* ==========================================
   GLASSMORPHISM CARD
   ========================================== */

.auth-card {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 25px 45px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    position: relative;
    overflow: hidden;
    animation: cardEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s;
}

.auth-card:hover::before {
    left: 100%;
}

/* Email Management Card - größer */
.email-management-card {
    max-width: 600px;
}

/* ==========================================
   LOGO & HEADER
   ========================================== */

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo {
    font-size: 32px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.auth-logo-divider {
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    margin: 12px auto;
}

.auth-edition {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 4px;
    text-transform: uppercase;
}

.auth-title {
    font-size: 24px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.auth-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    text-align: center;
    margin-bottom: 25px;
}

/* ==========================================
   FORM STYLING (für Django allauth forms)
   ========================================== */

/* Form Container */
.form-fields {
    width: 100%;
}

/* Django form.as_p styling */
.form-fields p {
    margin-bottom: 25px;
    position: relative;
}

/* Labels */
.form-fields label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Input Fields */
.form-fields input[type="text"],
.form-fields input[type="email"],
.form-fields input[type="password"] {
    width: 100%;
    padding: 18px 20px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-sizing: border-box;
}

.form-fields input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
}

.form-fields input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.1),
        0 10px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Checkbox styling */
.form-fields input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    vertical-align: middle;
}

.form-fields input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: rgba(255, 255, 255, 0.5);
}

.form-fields input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

/* Remember Me Row - Checkbox und Label in einer Zeile */
.remember-me-row {
    display: flex;
    align-items: center;
    gap: 0;
}

.remember-me-row label {
    display: inline;
    margin-bottom: 0;
    cursor: pointer;
}

/* ==========================================
   ALLAUTH BUTTON STYLING
   ========================================== */

/* Allauth button elements */
form button[type="submit"],
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: 56px;
    text-transform: none;
    letter-spacing: 0.5px;
    box-sizing: border-box;
    width: 100%;
    margin-bottom: 15px;
}

/* Primary button (submit) */
form button[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

form button[type="submit"]:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

form button[type="submit"]:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Secondary button */
.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

/* Disabled state */
form button:disabled,
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button hover effect */
form button::before,
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

form button:hover::before,
.btn:hover::before {
    left: 100%;
}

/* ==========================================
   LINKS & ACTIONS
   ========================================== */

.auth-links {
    text-align: center;
    margin-top: 25px;
}

.auth-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.auth-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transform: translateY(-1px);
}

.divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.divider span {
    padding: 0 20px;
    font-weight: 300;
}

/* ==========================================
   ERROR MESSAGES (Django allauth)
   ========================================== */

.errorlist {
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
}

.errorlist .error-item,
.errorlist li {
    background: rgba(220, 53, 69, 0.15);
    color: #ff6b7a;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(220, 53, 69, 0.3);
    backdrop-filter: blur(10px);
    font-size: 14px;
    animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Field-specific errors */
.form-fields ul.errorlist {
    margin-top: 8px;
    margin-bottom: 0;
}

/* Non-field errors */
.non-field-errors {
    margin-bottom: 20px;
}

/* ==========================================
   SUCCESS MESSAGES
   ========================================== */

.messages {
    margin-bottom: 25px;
}

.messages .success {
    background: rgba(40, 167, 69, 0.15);
    color: #4ade80;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(40, 167, 69, 0.3);
    backdrop-filter: blur(10px);
    font-size: 14px;
    animation: successPulse 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(0.95); opacity: 0; }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); opacity: 1; }
}

/* ==========================================
   INFO BOX STYLING
   ========================================== */

.auth-info-box {
    background: rgba(23, 162, 184, 0.15);
    border: 1px solid rgba(23, 162, 184, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    backdrop-filter: blur(10px);
}

.auth-info-box i {
    color: #17a2b8;
    font-size: 20px;
    margin-top: 2px;
    flex-shrink: 0;
}

.auth-info-box p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
}

/* Warning Box Variant */
.auth-warning-box {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.3);
}

.auth-warning-box i {
    color: #ffc107;
}

.auth-warning-box strong {
    display: block;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 1);
    font-weight: 600;
}

/* Error Box Variant */
.auth-error-box {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.3);
}

.auth-error-box i {
    color: #dc3545;
}

/* Success Box Variant */
.auth-success-box {
    background: rgba(40, 167, 69, 0.15);
    border-color: rgba(40, 167, 69, 0.3);
}

.auth-success-box i {
    color: #28a745;
}

/* ==========================================
   LOGOUT-SPECIFIC STYLING
   ========================================== */

/* Logout button styling */
button[tags*="logout"] {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.3);
}

button[tags*="logout"]:hover:not(:disabled) {
    background: linear-gradient(135deg, #c82333 0%, #a71d2a 100%);
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(220, 53, 69, 0.4);
}

button[tags*="logout"]:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.3);
}

/* ==========================================
   EMAIL MANAGEMENT STYLING
   ========================================== */

.email-list-section,
.add-email-section {
    margin: 24px 0;
    padding: 20px 0;
}

.email-list-section h3,
.add-email-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 8px;
}

.email-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.email-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.email-item.primary {
    border-color: rgba(255, 193, 7, 0.4);
    background: rgba(255, 193, 7, 0.1);
}

.email-info {
    flex: 1;
}

.email-address {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
}

.email-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.email-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.email-badge.verified {
    background: rgba(40, 167, 69, 0.2);
    color: #4ade80;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.email-badge.unverified {
    background: rgba(255, 193, 7, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.email-badge.primary {
    background: rgba(0, 123, 255, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(0, 123, 255, 0.3);
}

.email-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.email-actions form {
    margin: 0;
}

.email-actions button {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Small Button Variants */
button[tags*="small"] {
    padding: 6px 12px;
    font-size: 12px;
    min-height: auto;
    margin: 0;
    width: auto;
}

button[tags*="resend"] {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: #fff;
}

button[tags*="resend"]:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
}

button[tags*="primary"] {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

button[tags*="primary"]:hover {
    background: linear-gradient(135deg, #e0a800 0%, #d39e00 100%);
}

button[tags*="danger"] {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
}

button[tags*="danger"]:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71d2a 100%);
}

button[tags*="add"] {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: #fff;
}

button[tags*="add"]:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
}

/* ==========================================
   TERMS NOTICE STYLING
   ========================================== */

.auth-terms-notice {
    text-align: center;
    margin: 16px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-terms-notice small {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    line-height: 1.4;
}

.auth-terms-notice a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

.auth-terms-notice a:hover {
    color: #fff;
    text-decoration: none;
}

/* ==========================================
   SOCIAL ACCOUNT STYLING
   ========================================== */

.social-account-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin: 20px 0;
}

.social-provider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.social-provider i {
    font-size: 20px;
    color: #4285f4; /* Google Blue als Standard */
}

.social-data {
    margin: 8px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.social-data strong {
    color: rgba(255, 255, 255, 0.9);
}

/* ==========================================
   MFA STYLING
   ========================================== */

.mfa-code-input input[type="text"] {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 4px;
    font-family: 'Courier New', monospace;
}

.mfa-confirmation-warning {
    margin: 20px 0;
    padding: 16px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
}

.confirmation-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.4;
}

.confirmation-checkbox input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
}

/* Recovery Codes */
.recovery-codes-section {
    margin: 24px 0;
}

.recovery-codes-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
    text-align: center;
}

.recovery-codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.recovery-code-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.recovery-code-item code {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: none;
    letter-spacing: 1px;
}

.recovery-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

/* Recovery Use Section */
.recovery-use-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
    text-align: center;
}

/* ==========================================
   RATE LIMIT / MAINTENANCE STYLING
   ========================================== */

.rate-limit-status,
.maintenance-status {
    margin: 24px 0;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 4px;
    transition: width 1s linear;
    width: 0%;
}

.countdown-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

#countdown-display,
#refresh-countdown {
    font-weight: 600;
    color: #ffc107;
    font-size: 16px;
}

.auto-refresh-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.refresh-countdown {
    font-size: 18px;
    font-weight: 600;
    color: #17a2b8;
}

/* ==========================================
   BUTTON VARIANTS
   ========================================== */

/* MFA specific buttons */
button[tags*="verify"] {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: #fff;
}

button[tags*="verify"]:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
}

button[tags*="recovery"] {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
    color: #fff;
}

button[tags*="recovery"]:hover {
    background: linear-gradient(135deg, #545b62 0%, #3d4142 100%);
}

button[tags*="deactivate"] {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: #fff;
}

button[tags*="deactivate"]:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71d2a 100%);
}

button[tags*="deactivate"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Error-specific button colors */
button[onclick*="history.back()"],
button[onclick*="location.reload()"] {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

button[onclick*="history.back()"]:hover,
button[onclick*="location.reload()"]:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Debug info styling */
.auth-info-box small {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.6;
    word-break: break-all;
}

/* ==========================================
   PROVIDER ICONS
   ========================================== */

.bi-google { color: #4285f4; }
.bi-facebook { color: #1877f2; }
.bi-twitter { color: #1da1f2; }
.bi-github { color: #333; }
.bi-linkedin { color: #0077b5; }
.bi-microsoft { color: #00a1f1; }
.bi-apple { color: #000; }

/* ==========================================
   ANIMATIONS
   ========================================== */

.social-account-info {
    animation: slideInFromLeft 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.recovery-code-item {
    animation: fadeInScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation-fill-mode: both;
}

.recovery-code-item:nth-child(1) { animation-delay: 0.1s; }
.recovery-code-item:nth-child(2) { animation-delay: 0.2s; }
.recovery-code-item:nth-child(3) { animation-delay: 0.3s; }
.recovery-code-item:nth-child(4) { animation-delay: 0.4s; }
.recovery-code-item:nth-child(5) { animation-delay: 0.5s; }
.recovery-code-item:nth-child(6) { animation-delay: 0.6s; }
.recovery-code-item:nth-child(7) { animation-delay: 0.7s; }
.recovery-code-item:nth-child(8) { animation-delay: 0.8s; }

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.email-item {
    animation: emailItemEntrance 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes emailItemEntrance {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.email-actions button:active {
    transform: scale(0.95);
}

/* Pulsing effect for countdown */
#countdown-display,
#refresh-countdown {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
    .auth-container {
        padding: 15px;
    }

    .auth-card {
        padding: 30px 25px;
        max-width: 100%;
        border-radius: 16px;
    }

    .auth-logo {
        font-size: 28px;
    }

    .auth-title {
        font-size: 20px;
    }

    .form-fields input {
        padding: 16px 18px;
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }

    .btn {
        padding: 14px 28px;
        font-size: 15px;
    }

    .social-account-info {
        margin: 16px 0;
        padding: 12px;
    }

    .recovery-codes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .recovery-actions {
        flex-direction: column;
        align-items: center;
    }

    .recovery-actions .btn {
        width: 100%;
        max-width: 200px;
    }

    .mfa-code-input input[type="text"] {
        font-size: 20px;
        letter-spacing: 2px;
    }

    .auto-refresh-info {
        flex-direction: column;
        gap: 4px;
    }

    .email-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .email-actions {
        width: 100%;
        justify-content: center;
    }

    .email-actions button {
        flex: 1;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 25px 20px;
        border-radius: 12px;
    }

    .auth-header {
        margin-bottom: 30px;
    }

    .form-fields p {
        margin-bottom: 20px;
    }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    body::before {
        animation: none;
    }

    body {
        animation: none;
        background: linear-gradient(-45deg, #667eea, #764ba2);
    }
}

@media (prefers-contrast: high) {
    .auth-card {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.4);
    }

    .form-fields input {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.4);
    }
}

/* ==========================================
   FOCUS MANAGEMENT
   ========================================== */

.btn:focus,
.form-fields input:focus,
.auth-link:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* ==========================================
   LOADING STATES
   ========================================== */

.btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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