/* =========================================
   LOGIN PAGE STYLES
   ========================================= */

.login-body {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	background-attachment: fixed;
	min-height: 100vh;
	font-family: 'Roboto', sans-serif;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	margin: 0;
	overflow-x: hidden;
	overflow-y: auto;
	/* Mobile optimizations */
	-webkit-overflow-scrolling: touch;
	-ms-overflow-style: -ms-autohiding-scrollbar;
}

.login-container {
	width: 100%;
	max-width: 1200px;
}

.login-card {
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.1);
	background: rgba(255,255,255,0.95);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255,255,255,0.2);
	padding: 40px 30px;
	width: 60%;
	margin: 0 auto !important;
	max-width: 450px;
	min-height: auto;
}

.logo-section {
	margin-bottom: 30px;
}

.login-logo {
	max-width: 120px;
	height: auto;
	margin-bottom: 20px;
}

.login-title {
	font-size: 24px;
	font-weight: 500;
	margin: 10px 0 5px 0;
}

.login-subtitle {
	font-size: 14px;
	margin: 0 0 30px 0;
}

/* =========================================
   MATERIAL WEB COMPONENTS CUSTOMIZATION
   ========================================= */

/* Container dos inputs */
.input-field {
	margin-bottom: 20px;
}

/* Customização dos campos Material Web */
md-outlined-text-field {
	width: 100%;
	--md-outlined-text-field-container-shape: 8px;
	--md-outlined-text-field-outline-color: #e0e0e0;
	--md-outlined-text-field-focus-outline-color: #667eea;
	--md-outlined-text-field-hover-outline-color: #667eea;
	--md-outlined-text-field-label-text-color: #666;
	--md-outlined-text-field-input-text-color: #333;
	--md-outlined-text-field-supporting-text-color: #999;
	--md-outlined-text-field-error-outline-color: #f44336;
	--md-outlined-text-field-error-focus-outline-color: #f44336;
	--md-outlined-text-field-error-hover-outline-color: #f44336;
	--md-outlined-text-field-error-label-text-color: #f44336;
}

/* Estados de validação */
md-outlined-text-field[error] {
	--md-outlined-text-field-outline-color: #f44336;
	--md-outlined-text-field-label-text-color: #f44336;
}

md-outlined-text-field[error] md-icon[slot="leading-icon"] {
	color: #f44336;
}

/* Ícones leading (email, password) */
md-outlined-text-field md-icon[slot="leading-icon"] {
	color: #667eea;
	--md-icon-size: 20px;
}

md-outlined-text-field:focus-within md-icon[slot="leading-icon"] {
	color: #667eea;
}

/* Botão de toggle de visibilidade da senha */
md-outlined-text-field md-icon-button[slot="trailing-icon"] {
	--md-icon-button-state-layer-shape: 50%;
	--md-icon-button-icon-color: #666;
	--md-icon-button-hover-icon-color: #667eea;
	--md-icon-button-focus-icon-color: #667eea;
	--md-icon-button-pressed-icon-color: #667eea;
}

md-outlined-text-field md-icon-button[slot="trailing-icon"]:hover {
	--md-icon-button-icon-color: #667eea;
}

/* =========================================
   BUTTONS AND ACTIONS
   ========================================= */

.login-actions {
	margin-top: 20px;
}

/* Link "Esqueci minha senha" */
.forgot-password-link {
	text-align: center;
	margin: 15px 0;
}

.forgot-password-btn {
	color: #667eea;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: all 0.3s ease;
	padding: 8px 12px;
	border-radius: 6px;
}

.forgot-password-btn:hover {
	color: #5a72e8;
	background-color: rgba(102, 126, 234, 0.1);
	text-decoration: none;
	transform: translateY(-1px);
}

.forgot-password-btn i {
	font-size: 13px;
}

.btn-login {
	background: linear-gradient(45deg, #667eea, #764ba2);
	border: none;
	border-radius: 25px;
	font-size: 14px;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0.5px;
	width: 100%;
	margin: 20px 0 15px 0;
	transition: all 0.3s ease;
	height: 42px;
}

.btn-login:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
	background: linear-gradient(45deg, #5a72e8, #6a42a0);
}

.btn-login:focus {
	background: linear-gradient(45deg, #5a72e8, #6a42a0);
}

.btn-cadastro {
	background: transparent;
	border: 2px solid #667eea;
	color: #667eea;
	border-radius: 25px;
	font-size: 14px;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0.5px;
	width: 100%;
	margin: 10px 0;
	transition: all 0.3s ease;
	text-decoration: none;
	display: inline-block;
	text-align: center;
	height: 42px;
	line-height: 38px;
}

.btn-cadastro:hover {
	background: #667eea;
	color: white;
	transform: translateY(-2px);
	text-decoration: none;
}

.btn-cadastro:focus {
	background: #667eea;
	color: white;
	text-decoration: none;
}

/* =========================================
   GOOGLE LOGIN SECTION
   ========================================= */

.google-btn {
	margin: 15px 0;
	text-align: center;
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 44px;
}

.google-btn .g_id_signin {
	margin: 0 auto;
	width: 100%;
	max-width: 100%;
}

/* Forçar centralização do iframe do Google */
.google-btn .S9gUrf-YoZ4jf {
	margin: 0 auto !important;
	text-align: center !important;
}

.google-btn iframe {
	margin: 0 auto !important;
	max-width: 100% !important;
}

.divider {
	text-align: center;
	margin: 20px 0;
	position: relative;
}

.divider::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 1px;
	background: #e0e0e0;
}

.divider span {
	background: rgba(255,255,255,0.95);
	padding: 0 15px;
	color: #9e9e9e;
	font-size: 12px;
}

/* Mobile optimizations for Google login */
@media (max-width: 640px) {
	.google-btn {
		margin: 20px 0 25px 0;
		min-height: 50px;
	}
	
	.google-btn .g_id_signin {
		width: 100%;
	}
	
	.google-btn iframe {
		width: 100% !important;
		min-width: 100% !important;
	}
	
	.divider {
		margin: 25px 0;
	}
	
	.divider span {
		font-size: 13px;
		padding: 0 20px;
		font-weight: 500;
	}
	
	.divider::before {
		height: 2px;
		background: linear-gradient(90deg, transparent, #e0e0e0 20%, #e0e0e0 80%, transparent);
	}
}

@media (max-width: 480px) {
	.google-btn {
		margin: 18px 0 20px 0;
	}
	
	.divider {
		margin: 20px 0;
	}
}

@media (max-width: 360px) {
	.google-btn {
		margin: 15px 0 18px 0;
		min-height: 48px;
	}
}

/* =========================================
   FORGOT PASSWORD MODAL
   ========================================= */

#forgot-password-modal {
	max-width: 500px;
}

#forgot-password-modal .modal-content h4 {
	color: #667eea;
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
}

#forgot-password-modal .modal-content p {
	color: #666;
	margin-bottom: 25px;
	line-height: 1.6;
}

#forgot-password-modal .input-field {
	margin-bottom: 20px;
}

.recovery-message {
	padding: 12px 16px;
	border-radius: 6px;
	margin: 15px 0;
	font-size: 14px;
	font-weight: 500;
}

.recovery-message.success {
	background-color: #e8f5e8;
	border-left: 4px solid #4caf50;
	color: #2e7d32;
}

.recovery-message.error {
	background-color: #ffebee;
	border-left: 4px solid #f44336;
	color: #c62828;
}

.recovery-message.info {
	background-color: #e3f2fd;
	border-left: 4px solid #2196f3;
	color: #1565c0;
}

/* Mobile optimizations for forgot password modal */
@media (max-width: 640px) {
	#forgot-password-modal {
		margin: 15px;
		max-width: calc(100vw - 30px);
		border-radius: 12px;
	}
	
	#forgot-password-modal .modal-content {
		padding: 25px 20px;
	}
	
	#forgot-password-modal .modal-content h4 {
		font-size: 20px;
		margin-bottom: 18px;
	}
	
	#forgot-password-modal .modal-content p {
		font-size: 15px;
		margin-bottom: 22px;
		line-height: 1.5;
	}
	
	#forgot-password-modal .input-field {
		margin-bottom: 18px;
	}
	
	#forgot-password-modal md-outlined-text-field {
		--md-outlined-text-field-container-height: 52px;
		font-size: 15px;
	}
	
	#forgot-password-modal .modal-footer {
		padding: 15px 20px;
		justify-content: space-between;
	}
	
	#forgot-password-modal .modal-footer button {
		height: 42px;
		font-size: 14px;
		padding: 0 20px;
		border-radius: 21px;
	}
	
	.recovery-message {
		padding: 14px 16px;
		font-size: 14px;
		margin: 12px 0;
		border-radius: 8px;
	}
}

/* =========================================
   RESET PASSWORD PAGE
   ========================================= */

.reset-password-form {
	max-width: 450px;
	margin: 0 auto;
}

.reset-password-header {
	text-align: center;
	margin-bottom: 30px;
}

.reset-password-header h4 {
	color: #667eea;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-bottom: 15px;
	font-size: 24px;
	font-weight: 500;
}

.reset-password-header p {
	color: #666;
	margin: 0;
	font-size: 16px;
}

.password-requirements {
	background: #f8f9fa;
	border-radius: 8px;
	padding: 15px;
	margin: 20px 0;
	border-left: 4px solid #667eea;
}

.password-requirements h6 {
	color: #667eea;
	margin: 0 0 10px 0;
	font-size: 14px;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 6px;
}

.password-requirements ul {
	margin: 0;
	padding-left: 20px;
}

.password-requirements li {
	color: #666;
	font-size: 13px;
	line-height: 1.6;
}

.reset-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 25px;
}

.btn-reset {
	background: linear-gradient(45deg, #667eea, #764ba2);
	border: none;
	border-radius: 25px;
	font-size: 14px;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0.5px;
	width: 100%;
	height: 42px;
	transition: all 0.3s ease;
}

.btn-reset:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
	background: linear-gradient(45deg, #5a72e8, #6a42a0);
}

.btn-cancel {
	background: transparent;
	border: 2px solid #999;
	color: #999;
	border-radius: 25px;
	font-size: 14px;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0.5px;
	width: 100%;
	height: 42px;
	line-height: 38px;
	transition: all 0.3s ease;
	text-decoration: none;
	text-align: center;
}

.btn-cancel:hover {
	background: #999;
	color: white;
	transform: translateY(-2px);
	text-decoration: none;
}

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

/* Tablets em landscape */
@media (max-width: 1024px) {
	.login-card {
		width: 70%;
		padding: 35px 25px;
	}
}

/* Tablets em portrait */
@media (max-width: 768px) {
	.login-card {
		width: 85%;
		padding: 30px 20px;
	}
	
	.login-title {
		font-size: 22px;
	}
}

/* Smartphones grandes */
@media (max-width: 640px) {
	.login-body {
		padding: 15px 10px;
		align-items: flex-start;
		padding-top: 20px;
	}
	
	.login-card {
		width: 100%;
		max-width: none;
		margin: 0 !important;
		padding: 25px 20px;
		border-radius: 16px;
		min-height: calc(100vh - 40px);
		display: flex;
		flex-direction: column;
		justify-content: center;
	}
	
	.logo-section {
		margin-bottom: 25px;
	}
	
	.login-logo {
		max-width: 90px;
		margin-bottom: 15px;
	}
	
	.login-title {
		font-size: 20px;
		margin: 8px 0 5px 0;
	}
	
	.login-subtitle {
		font-size: 13px;
		margin: 0 0 25px 0;
	}
	
	/* Campos de input otimizados para mobile */
	.input-field {
		margin-bottom: 18px;
	}
	
	md-outlined-text-field {
		--md-outlined-text-field-container-height: 56px;
		font-size: 16px; /* Evita zoom no iOS */
	}
	
	/* Botões maiores para melhor toque */
	.btn-login,
	.btn-register,
	.btn-cadastro {
		height: 50px;
		font-size: 16px;
		border-radius: 25px;
		margin: 15px 0;
	}
	
	.btn-login {
		margin: 25px 0 20px 0;
	}
	
	/* Google button responsivo */
	.google-btn {
		margin: 20px 0;
	}
	
	.divider {
		margin: 25px 0;
	}
	
	.divider span {
		font-size: 13px;
		padding: 0 20px;
	}
	
	/* Link "Esqueci minha senha" maior */
	.forgot-password-btn {
		font-size: 15px;
		padding: 12px 16px;
		border-radius: 8px;
	}
	
	.login-actions {
		margin-top: 15px;
	}
}

/* Smartphones pequenos */
@media (max-width: 480px) {
	.login-body {
		padding: 10px 8px;
		padding-top: 15px;
	}
	
	.login-card {
		padding: 20px 15px;
		border-radius: 12px;
	}
	
	.logo-section {
		margin-bottom: 20px;
	}
	
	.login-logo {
		max-width: 80px;
		margin-bottom: 12px;
	}
	
	.login-title {
		font-size: 18px;
		margin: 5px 0 3px 0;
	}
	
	.login-subtitle {
		font-size: 12px;
		margin: 0 0 20px 0;
	}
	
	/* Campos ainda mais otimizados */
	.input-field {
		margin-bottom: 15px;
	}
	
	md-outlined-text-field {
		--md-outlined-text-field-container-height: 52px;
	}
	
	/* Botões ainda maiores para telas pequenas */
	.btn-login,
	.btn-register,
	.btn-cadastro {
		height: 48px;
		font-size: 15px;
		font-weight: 600;
	}
	
	.divider {
		margin: 20px 0;
	}
	
	/* Modal otimizada para mobile pequeno */
	#forgot-password-modal {
		margin: 10px;
		max-width: calc(100vw - 20px);
	}
	
	#forgot-password-modal .modal-content {
		padding: 20px 15px;
	}
	
	#forgot-password-modal .modal-content h4 {
		font-size: 18px;
		margin-bottom: 15px;
	}
	
	#forgot-password-modal .modal-footer {
		padding: 10px 15px;
	}
	
	.recovery-message {
		font-size: 13px;
		padding: 10px 12px;
		margin: 12px 0;
	}
}

/* Altura baixa (landscape em smartphones) */
@media (max-height: 600px) {
	.login-body {
		align-items: flex-start;
		padding-top: 10px;
		padding-bottom: 10px;
	}
	
	.login-card {
		min-height: auto;
		margin-top: 0 !important;
		margin-bottom: 0 !important;
	}
	
	.logo-section {
		margin-bottom: 15px;
	}
	
	.login-logo {
		max-width: 70px;
		margin-bottom: 8px;
	}
	
	.login-title {
		font-size: 16px;
		margin: 5px 0 2px 0;
	}
	
	.login-subtitle {
		font-size: 11px;
		margin: 0 0 15px 0;
	}
	
	.input-field {
		margin-bottom: 12px;
	}
	
	.btn-login,
	.btn-register,
	.btn-cadastro {
		height: 42px;
		margin: 10px 0;
	}
	
	.divider {
		margin: 15px 0;
	}
}

/* Extra pequeno (smartphones muito pequenos) */
@media (max-width: 360px) {
	.login-card {
		padding: 15px 12px;
	}
	
	md-outlined-text-field {
		--md-outlined-text-field-container-height: 50px;
	}
	
	.btn-login,
	.btn-register,
	.btn-cadastro {
		height: 46px;
		font-size: 14px;
	}
	
	.forgot-password-btn {
		font-size: 14px;
		padding: 10px 12px;
	}
}

/* =========================================
   MOBILE TOUCH OPTIMIZATIONS
   ========================================= */

/* Improved touch targets for mobile */
@media (max-width: 640px) {
	/* Ensure all clickable elements have minimum 44px touch target */
	button, 
	.btn, 
	md-icon-button, 
	.forgot-password-btn,
	.login-redirect-link {
		min-height: 44px;
		min-width: 44px;
		-webkit-tap-highlight-color: rgba(0,0,0,0.1);
		touch-action: manipulation;
	}
	
	/* Better scroll behavior */
	.login-card {
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
	}
	
	/* Prevent zoom on input focus (iOS) */
	input,
	textarea,
	select,
	md-outlined-text-field {
		font-size: 16px !important;
		-webkit-appearance: none;
		-webkit-border-radius: 0;
		border-radius: 0;
	}
	
	/* Better focus states for accessibility */
	button:focus,
	.btn:focus,
	md-outlined-text-field:focus-within {
		outline: 2px solid #667eea;
		outline-offset: 2px;
	}
	
	/* Improved active states */
	button:active,
	.btn:active {
		transform: scale(0.98);
	}
	
	/* Better visual feedback for touch */
	.forgot-password-btn:active {
		background-color: rgba(102, 126, 234, 0.2);
	}
	
	/* Optimize modal for mobile interaction */
	.modal {
		-webkit-overflow-scrolling: touch;
	}
}

/* High DPI displays optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
	.login-logo {
		image-rendering: -webkit-optimize-contrast;
		image-rendering: crisp-edges;
	}
}

/* =========================================
   FLASH MESSAGES
   ========================================= */

.flash-message {
	margin-bottom: 20px;
	border-radius: 8px;
	padding: 12px 16px;
	font-size: 14px;
	line-height: 1.4;
}

.flash-message.error {
	background-color: #ffebee;
	border-left: 4px solid #f44336;
	color: #c62828;
}

.flash-message.success {
	background-color: #e8f5e8;
	border-left: 4px solid #4caf50;
	color: #2e7d32;
}

.flash-message.warning {
	background-color: #fff3e0;
	border-left: 4px solid #ff9800;
	color: #e65100;
}

/* Mobile optimizations for flash messages */
@media (max-width: 640px) {
	.flash-message {
		margin-bottom: 18px;
		padding: 14px 16px;
		font-size: 14px;
		border-radius: 10px;
		box-shadow: 0 2px 8px rgba(0,0,0,0.1);
		border-left-width: 5px;
		line-height: 1.5;
	}
}

@media (max-width: 480px) {
	.flash-message {
		margin-bottom: 15px;
		padding: 12px 14px;
		font-size: 13px;
		border-radius: 8px;
	}
}

/* =========================================
   REGISTER PAGE STYLES
   ========================================= */

.register-choice {
	text-align: center;
	margin: 20px 0;
}

.btn-google-choice,
.btn-manual-choice {
	width: 100%;
	margin: 8px 0;
	padding: 12px 20px;
	border: none;
	border-radius: 25px;
	font-size: 14px;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0.5px;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	cursor: pointer;
	min-height: 42px;
}

.btn-google-choice {
	background: linear-gradient(45deg, #db4437, #dd4b39);
	color: white;
}

.btn-google-choice:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(219, 68, 55, 0.4);
	background: linear-gradient(45deg, #d23429, #db4437);
	color: white;
}

.btn-manual-choice {
	background: linear-gradient(45deg, #667eea, #764ba2);
	color: white;
}

.btn-manual-choice:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
	background: linear-gradient(45deg, #5a72e8, #6a42a0);
	color: white;
}

.register-section {
	margin-top: 20px;
}

.register-actions {
	margin-top: 25px;
}

.btn-register {
	background: linear-gradient(45deg, #4caf50, #388e3c);
	border: none;
	border-radius: 25px;
	font-size: 14px;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0.5px;
	width: 100%;
	margin: 15px 0;
	transition: all 0.3s ease;
	height: 42px;
}

.btn-register:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
	background: linear-gradient(45deg, #45a049, #2e7d32);
}

.btn-register:focus {
	background: linear-gradient(45deg, #45a049, #2e7d32);
}

.btn-register:disabled {
	background: #cccccc;
	color: #666;
	transform: none;
	box-shadow: none;
	cursor: not-allowed;
}

.back-to-choice {
	text-align: center;
	margin: 20px 0 10px 0;
}

.btn-back {
	background: transparent;
	border: 2px solid #999;
	color: #999;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 500;
	text-transform: none;
	padding: 8px 16px;
	transition: all 0.3s ease;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	min-height: 36px;
}

.btn-back:hover {
	background: #999;
	color: white;
	transform: translateY(-1px);
}

.login-link {
	text-align: center;
	margin-top: 20px;
	padding-top: 15px;
	border-top: 1px solid #e0e0e0;
	font-size: 14px;
	color: #666;
}

.plans-link {
	text-align: center;
}

.login-redirect-link {
	color: #667eea;
	text-decoration: none;
	font-weight: 500;
	transition: all 0.3s ease;
}

.login-redirect-link:hover {
	color: #5a72e8;
	text-decoration: underline;
}

.alert-message {
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 15px;
	font-size: 14px;
	font-weight: 500;
	display: none;
}

.alert-message.success {
	background-color: #e8f5e8;
	border-left: 4px solid #4caf50;
	color: #2e7d32;
}

.alert-message.error {
	background-color: #ffebee;
	border-left: 4px solid #f44336;
	color: #c62828;
}

/* Customização dos campos de registro */
.register-section md-outlined-text-field {
	--md-outlined-text-field-focus-outline-color: #4caf50;
	--md-outlined-text-field-hover-outline-color: #4caf50;
}

.register-section md-icon[slot="leading-icon"] {
	color: #4caf50;
}

.register-section md-outlined-text-field:focus-within md-icon[slot="leading-icon"] {
	color: #4caf50;
}

/* Mobile optimizations for register page */
@media (max-width: 640px) {
	.register-choice {
		margin: 15px 0;
	}
	
	.btn-google-choice,
	.btn-manual-choice {
		height: 50px;
		font-size: 15px;
		margin: 10px 0;
		padding: 14px 20px;
	}
	
	.register-actions {
		margin-top: 20px;
	}
	
	.back-to-choice {
		margin: 15px 0 8px 0;
	}
	
	.btn-back {
		font-size: 14px;
		padding: 10px 18px;
		min-height: 40px;
	}
	
	.login-link {
		margin-top: 15px;
		padding-top: 12px;
		font-size: 13px;
	}
}

@media (max-width: 480px) {
	.btn-google-choice,
	.btn-manual-choice {
		height: 48px;
		font-size: 14px;
		padding: 12px 18px;
	}
	
	.btn-back {
		font-size: 13px;
		padding: 8px 16px;
		min-height: 38px;
	}
}

@media (max-width: 360px) {
	.btn-google-choice,
	.btn-manual-choice {
		height: 46px;
		font-size: 13px;
		padding: 10px 16px;
	}
}