/* Login and Registration Links */
.aotg-login-link,
.aotg-registration-link {
    display: inline-block;
    text-decoration: underline;
    cursor: pointer;
    font-size: 1.5rem;
}

.aotg-login-link:hover,
.aotg-registration-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Modal Styles */
.aotg-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(44, 62, 80, 0.6);
    backdrop-filter: blur(8px);
    animation: aotgFadeIn 0.3s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes aotgFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.aotg-modal-content {
    background: #ffffff;
    margin: 0 auto;
    border: none;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: aotgSlideIn 0.3s ease-out;
    overflow: hidden;
    position: relative;
}

@keyframes aotgSlideIn {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.aotg-modal-header {
    padding: 32px 40px 24px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    position: relative;
    text-align: center;
}

.aotg-modal-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.5px;
}

.aotg-close {
    position: absolute;
    right: 24px;
    top: 32px;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    color: rgba(255, 255, 255, 0.8);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.aotg-close:hover,
.aotg-close:focus {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
    text-decoration: none;
}

.aotg-modal-body {
    padding: 40px;
    background: #ffffff;
}

/* Form Styles with AOTG prefix to avoid conflicts */
#aotg-login-form,
#aotg-registration-form {
    margin: 0;
}

.aotg-form-group {
    margin-bottom: 24px;
}

.aotg-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aotg-form-control {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
    background: #f8f9fa;
    color: #2c3e50;
}

.aotg-form-control:focus {
    outline: none;
    border-color: #3498db;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.aotg-form-control::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

.aotg-btn {
    display: inline-block;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aotg-btn-primary {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.aotg-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
}

.aotg-btn-primary:active {
    transform: translateY(0);
}

.aotg-btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.3);
}

.aotg-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.aotg-btn-block {
    width: 100%;
}

.aotg-text-center {
    text-align: center;
}

/* Alert Styles with AOTG prefix */
.aotg-alert {
    padding: 16px 20px;
    margin-bottom: 24px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.aotg-alert-danger {
    color: #721c24;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left: 4px solid #dc3545;
}

.aotg-alert-success {
    color: #155724;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
}

/* Loading States */
.aotg-login-loading .aotg-icon-spin {
    animation: aotgSpin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes aotgSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.aotg-forgot-link {
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(52, 152, 219, 0.1);
}

.aotg-forgot-link:hover {
    color: #2980b9;
    background: rgba(52, 152, 219, 0.15);
    text-decoration: none;
    transform: translateY(-1px);
}

/* Loading text styling */
.aotg-login-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Loading spinner for form container */
.aotg-text-center .aotg-icon-spin {
    animation: aotgSpin 1s linear infinite;
    color: #3498db;
    font-size: 24px;
    margin-bottom: 16px;
}

/* Form container loading state */
#aotg-login-form-container {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#aotg-login-form-container .aotg-text-center {
    text-align: center;
    color: #6c757d;
}

#aotg-login-form-container .aotg-text-center p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .aotg-modal-content {
        margin: 20px;
        width: calc(100% - 40px);
        border-radius: 12px;
    }
    
    .aotg-modal-header,
    .aotg-modal-body {
        padding: 24px;
    }
    
    .aotg-modal-header h2 {
        font-size: 24px;
    }
    
    .aotg-form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px;
    }
    
    .aotg-btn {
        padding: 14px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .aotg-modal-content {
        margin: 10px;
        width: calc(100% - 20px);
        border-radius: 8px;
    }
    
    .aotg-modal-header,
    .aotg-modal-body {
        padding: 20px;
    }
    
    .aotg-modal-header h2 {
        font-size: 20px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .aotg-modal-content {
        border: 2px solid #000;
    }
    
    .aotg-form-control {
        border-color: #000;
    }
    
    .aotg-btn-primary {
        background: #000;
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .aotg-modal,
    .aotg-modal-content,
    .aotg-login-link,
    .aotg-registration-link,
    .aotg-form-control,
    .aotg-btn {
        animation: none;
        transition: none;
    }
}

/* Reset any potential conflicts */
.aotg-modal * {
    box-sizing: border-box;
}

.aotg-modal input,
.aotg-modal button,
.aotg-modal textarea,
.aotg-modal select {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* Ensure modals appear above everything */
.aotg-modal {
    z-index: 999999 !important;
}