.cas-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.cas-overlay.active {
    display: block;
    opacity: 1;
}

.cas-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 99999;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cas-modal.active {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.cas-modal-small {
    max-width: 600px;
}

.cas-modal-content {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    position: relative;
}

.cas-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.cas-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg) scale(1.1);
}

.cas-modal-body {
    display: flex;
    min-height: 500px;
}

.cas-form-section {
    flex: 1;
    padding: 50px 40px;
    overflow-y: auto;
    max-height: 90vh;
}

.cas-image-section {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    display: none;
}

.cas-image-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.cas-form-section h1 {
    font-family: "IRANSans", tahoma, sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 30px;
    color: #1a1a1a;
}

.cas-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 100000;
    display: none;
    align-items: center;
    gap: 12px;
    font-family: "IRANSans", tahoma, sans-serif;
    font-size: 14px;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.cas-toast.active {
    display: flex;
}

.cas-toast.hiding {
    animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.cas-toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cas-toast.success .cas-toast-icon {
    background: #d4edda;
    color: #155724;
}

.cas-toast.error .cas-toast-icon {
    background: #f8d7da;
    color: #721c24;
}

.cas-toast.success .cas-toast-icon::before {
    content: "✓";
    font-weight: bold;
    font-size: 16px;
}

.cas-toast.error .cas-toast-icon::before {
    content: "✕";
    font-weight: bold;
    font-size: 16px;
}

.cas-toast-message {
    flex: 1;
    color: #333;
    line-height: 1.5;
}

.cas-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.cas-toast-close:hover {
    color: #333;
}

.cas-status-box {
    display: none;
}

.cas-loading-box {
    display: none;
    text-align: center;
    padding: 20px;
}

.cas-loading-box.active {
    display: block;
}

.cas-spinner {
    display: inline-flex;
    gap: 8px;
}

.cas-spinner div {
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.cas-spinner div:nth-child(1) {
    animation-delay: -0.32s;
}

.cas-spinner div:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%,
    80%,
    100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.cas-form-input {
    margin-bottom: 20px;
}

.cas-form-input label {
    display: block;
    font-family: "IRANSans", tahoma, sans-serif;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.cas-form-input input[type="text"],
.cas-form-input input[type="email"],
.cas-form-input input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: "IRANSans", tahoma, sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.cas-form-input input:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.cas-password-box {
    position: relative;
}

.cas-password-box input {
    padding-left: 45px;
}

.cas-toggle-password {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 8px;
    transition: color 0.3s ease;
}

.cas-toggle-password:hover {
    color: #667eea;
}

.cas-toggle-password svg {
    display: block;
}

.cas-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.cas-form-footer {
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.cas-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: "IRANSans", tahoma, sans-serif;
    font-size: 14px;
    color: #666;
    user-select: none;
}

.cas-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.cas-btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-family: "IRANSans", tahoma, sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cas-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.cas-btn-submit:active {
    transform: translateY(0);
}

.cas-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.cas-links {
    margin-top: 25px;
    text-align: center;
    font-family: "IRANSans", tahoma, sans-serif;
    font-size: 14px;
    color: #666;
}

.cas-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    margin: 0 8px;
}

.cas-links a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.cas-form-message {
    font-family: "IRANSans", tahoma, sans-serif;
    font-size: 13px;
    color: #999;
    margin: 15px 0;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .cas-image-section {
        display: block;
    }
}

@media (max-width: 767px) {
    .cas-modal {
        width: 95%;
        max-height: 95vh;
    }
    .cas-modal-body {
        min-height: auto;
    }
    .cas-form-section {
        padding: 30px 20px;
        max-height: 85vh;
    }
    .cas-form-section h1 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    .cas-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .cas-form-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .cas-checkbox {
        order: 2;
        justify-content: center;
    }
    .cas-btn-submit {
        width: 100%;
        order: 1;
    }
    .cas-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: calc(100% - 20px);
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .cas-close {
        width: 28px;
        height: 28px;
        font-size: 18px;
        top: 8px;
        right: 8px;
    }
    .cas-form-section {
        padding: 25px 15px;
    }
    .cas-form-section h1 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    .cas-form-input {
        margin-bottom: 15px;
    }
    .cas-form-input label {
        font-size: 13px;
    }
    .cas-form-input input {
        padding: 10px 14px;
        font-size: 13px;
    }
    .cas-password-box input {
        padding-left: 40px;
    }
    .cas-btn-submit {
        padding: 10px 24px;
        font-size: 14px;
    }
    .cas-links {
        font-size: 13px;
    }
    .cas-toast {
        font-size: 13px;
        padding: 12px 16px;
    }
}

@media (max-width: 360px) {
    .cas-form-section {
        padding: 20px 12px;
    }
    .cas-close {
        width: 26px;
        height: 26px;
        font-size: 16px;
    }
}