/* AGTI Authentication System - Unified Styles */
:root {
    --agti-primary: #ca8e46;
    --agti-secondary: #0d906b;
    --agti-text-dark: #333333;
    --agti-text-light: #ffffff;
    --agti-border: #e0e0e0;
    --agti-background: #f8f9fa;
    --agti-error: #dc3545;
    --agti-success: #28a745;
    --agti-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --agti-border-radius: 8px;
}

/* Override site-wide copy-protection user-select on auth form controls only */
.agti-copy-paste-exempt input,
.agti-copy-paste-exempt textarea,
.agti-copy-paste-exempt select {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* ========================================
   FORM CONTAINERS
   ======================================== */

.agti-login-form-container,
.agti-lost-password-form,
.agti-reset-password-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem;
}

.agti-login-form,
.agti-lost-password-form,
.agti-reset-password-form {
    background: var(--agti-text-light);
    border-radius: var(--agti-border-radius);
    box-shadow: var(--agti-shadow);
    border: 1px solid var(--agti-border);
    padding: 2rem;
}

/* ========================================
   FORM HEADERS
   ======================================== */

.agti-form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.agti-form-header h2 {
    color: var(--agti-primary);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-family: 'Arial', sans-serif;
}

.agti-form-header p {
    color: var(--agti-text-dark);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* ========================================
   FORM GROUPS
   ======================================== */

.agti-form-group {
    margin-bottom: 1.5rem;
}

.agti-form-group label {
    display: block;
    color: var(--agti-text-dark);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.agti-form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--agti-border);
    border-radius: var(--agti-border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.agti-form-group input:focus {
    outline: none;
    border-color: var(--agti-primary);
    box-shadow: 0 0 0 3px rgba(202, 142, 70, 0.1);
}

.agti-form-group input.error {
    border-color: var(--agti-error);
}

.agti-password-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.agti-password-wrapper input {
    width: 100%;
    padding-right: 45px;
    box-sizing: border-box;
}

.agti-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--agti-text-dark);
    transition: color 0.3s ease;
    border-radius: var(--agti-border-radius);
    z-index: 10;
}

.agti-password-toggle:hover {
    color: var(--agti-primary);
    background: rgba(202, 142, 70, 0.1);
}

.agti-password-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(202, 142, 70, 0.2);
}

.agti-password-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ========================================
   FORM LINKS
   ======================================== */

.agti-form-links {
    text-align: right;
    margin-bottom: 1.5rem;
}

.agti-form-links .agti-link {
    color: var(--agti-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.agti-form-links .agti-link:hover {
    color: #0a7a5a;
    text-decoration: underline;
}

/* ========================================
   BUTTONS
   ======================================== */

.agti-btn {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--agti-border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-family: 'Arial', sans-serif;
}

.agti-btn-primary {
    background: var(--agti-primary);
    color: var(--agti-text-light);
}

.agti-btn-primary:hover {
    background: #b87d3a;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(202, 142, 70, 0.3);
}

.agti-btn-primary:active {
    transform: translateY(0);
}

.agti-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   FORM FOOTER
   ======================================== */

.agti-form-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--agti-border);
}

.agti-form-footer p {
    margin: 0;
    color: var(--agti-text-dark);
    font-size: 0.9rem;
}

.agti-form-footer .agti-link {
    color: var(--agti-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.agti-form-footer .agti-link:hover {
    color: #b87d3a;
    text-decoration: underline;
}

/* ========================================
   MESSAGES
   ======================================== */

.agti-message {
    padding: 0.75rem 1rem;
    border-radius: var(--agti-border-radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.agti-message.success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--agti-success);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.agti-message.error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--agti-error);
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.agti-message.info {
    background: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
    border: 1px solid rgba(13, 202, 240, 0.2);
}

/* ========================================
   LOADING STATES
   ======================================== */

.agti-loading {
    position: relative;
    pointer-events: none;
}

.agti-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid var(--agti-text-light);
    border-radius: 50%;
    animation: agti-spin 1s linear infinite;
}

@keyframes agti-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   MODAL STYLES
   ======================================== */

.agti-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.agti-modal-content {
    background-color: var(--agti-text-light);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--agti-border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: agti-modal-slide-in 0.3s ease-out;
}

@keyframes agti-modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agti-modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--agti-text-dark);
    cursor: pointer;
    line-height: 1;
    z-index: 1;
    background: var(--agti-primary);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.agti-modal-close:hover {
    background: #b87d3a;
    transform: scale(1.1);
}

#agti-login-modal-body,
#agti-modal-body {
    padding: 2rem;
}

/* ========================================
   PASSWORD STRENGTH INDICATOR
   ======================================== */

.agti-password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background: var(--agti-border);
    border-radius: 2px;
    overflow: hidden;
}

.agti-password-strength-bar {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.agti-password-strength-bar.weak {
    background: var(--agti-error);
    width: 25%;
}

.agti-password-strength-bar.fair {
    background: #ffc107;
    width: 50%;
}

.agti-password-strength-bar.good {
    background: #17a2b8;
    width: 75%;
}

.agti-password-strength-bar.strong {
    background: var(--agti-success);
    width: 100%;
}

/* ========================================
   FORM VALIDATION STYLES
   ======================================== */

.agti-form-group .error-message {
    color: var(--agti-error);
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

.agti-form-group.error .error-message {
    display: block;
}

/* ========================================
   SUCCESS ANIMATION
   ======================================== */

.agti-success-animation {
    animation: agti-success-bounce 0.6s ease-out;
}

@keyframes agti-success-bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .agti-login-form-container,
    .agti-lost-password-form,
    .agti-reset-password-form {
        margin: 1rem;
        padding: 1rem;
    }
    
    .agti-login-form,
    .agti-lost-password-form,
    .agti-reset-password-form {
        padding: 1.5rem;
    }
    
    .agti-modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    #agti-login-modal-body,
    #agti-modal-body {
        padding: 1.5rem;
    }
    
    .agti-password-toggle {
        right: 8px;
    }
    
    .agti-password-wrapper input {
        padding-right: 40px;
    }
}

@media (max-width: 480px) {
    .agti-form-header h2 {
        font-size: 1.5rem;
    }
    
    .agti-btn {
        padding: 0.75rem 1rem;
    }
}

/* ========================================
   PASSWORD RESET - UNIFIED STEP FLOW
   ======================================== */

.agti-password-reset-container {
    max-width: 450px;
    margin: 0 auto;
    padding: 2rem;
}

.agti-reset-step {
    background: var(--agti-text-light);
    border-radius: var(--agti-border-radius);
    box-shadow: var(--agti-shadow);
    border: 1px solid var(--agti-border);
    padding: 2rem;
}

/* Success Icon */
.agti-success-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.agti-success-icon svg {
    color: var(--agti-secondary);
}

.agti-success-icon.large svg {
    width: 64px;
    height: 64px;
}

/* Email sent message */
.agti-email-sent-message {
    color: var(--agti-text-dark);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.agti-email-sent-message strong {
    color: var(--agti-secondary);
    word-break: break-all;
}

.agti-instruction-text {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Help text */
.agti-help-text {
    display: block;
    color: #888;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Resend text */
.agti-resend-text {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

/* Success header */
.agti-success-header {
    padding: 2rem 1rem;
}

.agti-success-header h2 {
    color: var(--agti-secondary);
}

.agti-success-header p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Step transitions */
.agti-reset-step {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Password strength bar */
.agti-password-strength {
    height: 4px;
    background: var(--agti-border);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.agti-password-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.agti-password-strength-bar.weak {
    width: 25%;
    background-color: #dc3545;
}

.agti-password-strength-bar.fair {
    width: 50%;
    background-color: #ffc107;
}

.agti-password-strength-bar.good {
    width: 75%;
    background-color: #17a2b8;
}

.agti-password-strength-bar.strong {
    width: 100%;
    background-color: var(--agti-secondary);
}

/* Responsive adjustments for password reset */
@media (max-width: 768px) {
    .agti-password-reset-container {
        padding: 1rem;
    }
    
    .agti-reset-step {
        padding: 1.5rem;
    }
    
    .agti-success-icon svg {
        width: 40px;
        height: 40px;
    }
    
    .agti-success-icon.large svg {
        width: 56px;
        height: 56px;
    }
}
