/* CSS Variables for Safe Areas */
:root {
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Register Container */
.register-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 20px;
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
    background: #E5E5E5;
}

.register-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 440px;
    animation: slideDown 0.8s ease-out;
}

/* Header */
.register-header {
    text-align: center;
    margin-bottom: 2.5rem;
    width: 100%;
}

.logo {
    width: 70px;
    height: 70px;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.app-name {
    font-family: 'Unbounded', sans-serif;
    font-size: 3rem;
    font-weight: 500;
    color: #282828;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 9px 2px 2px rgba(40, 40, 40, 0.14);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.page-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #282828;
    margin: 0 0 0.5rem 0;
    animation: fadeInUp 0.8s ease-out 0.5s both;
}

.page-subtitle {
    font-family: 'Unbounded', sans-serif;
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    line-height: 1.4;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

/* Form */
.register-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.7s both;
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Input Styles */
.input_container {
    display: flex;
    align-items: center;
    background-color: #CECECE;
    border-radius: 15px;
    padding: 12px 15px;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.input_container:focus-within {
    box-shadow: 0 0 0 2px rgba(40, 40, 40, 0.2);
    background-color: #ffffff;
}

.input_container img:first-child {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    flex-shrink: 0;
}

.input_area {
    border: none;
    background: transparent;
    outline: none;
    font-family: 'Unbounded', sans-serif;
    font-size: 0.9rem;
    color: #282828;
    width: 100%;
    flex: 1;
}

.input_area::placeholder {
    color: #282828;
    opacity: 0.5;
}

/* Password Toggle */
.password-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.password-toggle:hover {
    opacity: 1;
    background: rgba(40, 40, 40, 0.1);
}

.toggle-icon {
    width: 18px;
    height: 18px;
}

/* Input Hints */
.input-hint {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.25rem;
    padding: 0 4px;
}

/* Password Strength */
.password-strength {
    margin-top: 0.75rem;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: #CECECE;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: all 0.4s ease;
}

.strength-fill.empty {
    width: 0%;
    background: transparent;
}

.strength-fill.weak {
    width: 33.33%;
    background: #e74c3c;
}

.strength-fill.medium {
    width: 66.66%;
    background: #f39c12;
}

.strength-fill.strong {
    width: 100%;
    background: #27ae60;
}

.strength-text {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    font-weight: 500;
}

/* Password Match */
.password-match {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    text-align: center;
    font-weight: 500;
    min-height: 1rem;
}

.password-match.matching {
    color: #27ae60;
}

.password-match.not-matching {
    color: #e74c3c;
}

/* Agreement */
.form-agreement {
    margin: 0.5rem 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.checkbox-wrapper:hover {
    background: rgba(206, 206, 206, 0.3);
}

.checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #CECECE;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    margin-top: 0.125rem;
    transition: all 0.2s ease;
}

.checkbox-wrapper input:checked + .checkmark {
    background: #5E7B00;
    border-color: #5E7B00;
}

.checkbox-wrapper input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    color: #282828;
    flex: 1;
}

.checkbox-text a {
    color: #5E7B00;
    text-decoration: none;
    font-weight: 500;
}

.checkbox-text a:hover {
    text-decoration: underline;
}

/* Error Message */
.error-message {
    background-color: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 10px;
    padding: 12px;
    font-family: 'Unbounded', sans-serif;
    font-size: 0.8rem;
    color: #e74c3c;
    text-align: center;
    margin: 0.5rem 0;
}

.error-message.success {
    background-color: rgba(39, 174, 96, 0.1);
    border: 1px solid rgba(39, 174, 96, 0.3);
    color: #27ae60;
}

/* Register Button */
.register-button {
    background-color: #ffffff;
    border: none;
    border-radius: 15px;
    padding: 16px;
    font-family: 'Unbounded', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #282828;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.register-button:hover:not(:disabled) {
    background-color: #f5f5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.register-button:active:not(:disabled) {
    transform: translateY(0);
}

.register-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading Spinner */
.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid #5E7B00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Auth Redirect */
.auth-redirect {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(206, 206, 206, 0.5);
    color: #666;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.auth-link {
    color: #5E7B00;
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
}

.auth-link:hover {
    text-decoration: underline;
    color: #4a6100;
}

/* Animations */
@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .register-container {
        padding: 15px;
    }
    
    .app-name {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }
    
    .logo {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }
    
    .page-title {
        font-size: 1.3rem;
    }
    
    .page-subtitle {
        font-size: 0.85rem;
    }
    
    .register-form {
        gap: 1.25rem;
    }
    
    .form-grid {
        gap: 1rem;
    }
    
    .register-button {
        padding: 14px;
        height: 50px;
        font-size: 0.95rem;
    }
    
    .input_container {
        padding: 10px 12px;
    }
}

@media (max-width: 360px) {
    .app-name {
        font-size: 2.2rem;
    }
    
    .auth-redirect {
        font-size: 0.85rem;
    }
    
    .checkbox-text {
        font-size: 0.8rem;
    }
}

/* Landscape mode for mobile */
@media (orientation: landscape) and (max-height: 500px) {
    .register-content {
        transform: scale(0.85);
    }
    
    .register-header {
        margin-bottom: 1.5rem;
    }
    
    .register-form {
        gap: 1rem;
    }
}

/* Safe area support */
@supports (padding: max(0px)) {
    .register-container {
        padding-top: max(20px, var(--safe-area-top));
        padding-bottom: max(20px, var(--safe-area-bottom));
    }
}

/* Field validation states */
.input_container.success {
    box-shadow: 0 0 0 2px rgba(39, 174, 96, 0.3);
}

.input_container.error {
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.3);
}

/* Footer styles from login.css */
.minimal-footer {
    background: transparent;
    padding: 20px 15px;
    text-align: center;
    margin-top: 40px;
    animation: fadeInUp 0.8s ease-out 1s both;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.footer-link {
    font-family: 'Unbounded', sans-serif;
    font-size: 0.7rem;
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 4px 0;
}

.footer-link:hover {
    color: #5E7B00;
}

.separator {
    color: #CECECE;
    font-size: 0.7rem;
    user-select: none;
}

.footer-copyright {
    font-family: 'Unbounded', sans-serif;
    font-size: 0.65rem;
    color: #999;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .minimal-footer {
        padding: 15px 10px;
        margin-top: 30px;
    }
    
    .footer-links {
        gap: 6px;
    }
    
    .footer-link {
        font-size: 0.65rem;
    }
    
    .footer-copyright {
        font-size: 0.6rem;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .minimal-footer {
        padding: 10px 15px;
        margin-top: 20px;
    }
}